5

我正在从 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);
}

但我不知道如何隐藏顶部栏,“私人”启动它也很棒。有没有办法做到这一点?

4

2 回答 2

3

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

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

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

于 2013-11-24T23:47:31.760 回答
0

实际上最好的机会是使用 ChromeView 或 Chromium-View(我确实使用了最后一个,但该项目已被其作者删除),祝你好运!

于 2014-01-10T19:35:58.897 回答