gpt4 book ai didi

android - 以全屏模式启动 Chrome

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:56:30 26 4
gpt4 key购买 nike

我从 Android 应用程序启动 Chrome,我希望这看起来像我不会离开应用程序...为此,我确实以这种方式从 Intent 启动 chrome:

public void onClickApp(View view){
Intent intent = new Intent("android.intent.action.MAIN");
intent.setComponent(ComponentName.unflattenFromString("com.android.chrome/com.android.chrome.Main"));
intent.addCategory("android.intent.category.LAUNCHER");
intent.setData(Uri.parse("http://google.com"));
startActivity(intent);
}

但我不知道如何隐藏顶部栏,“私下”启动它也很好。有办法实现吗?

最佳答案

这是不可能的。 Android 版 Chrome 进入全屏模式的唯一方法是使用全屏 API:http://www.html5rocks.com/en/mobile/fullscreen/

但是,这需要用户交互才能使 UI 处于全屏模式,这并不是您想要的。

WebView 现在使用 Chrome 作为 KitKat 中的渲染引擎:https://developers.google.com/chrome/mobile/docs/webview/overview

关于android - 以全屏模式启动 Chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19140950/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com