簡體   English   中英

在Android中打開Xiomi本機瀏覽器?

[英]Open Xiomi native browser in android?

如何在Android中以編程方式打開xiomi(Mi Note 4瀏覽器)本機瀏覽器。 我可以打開Chrome瀏覽器。 在這里我為鉻編碼

Intent browserIntent = new Intent(
                    "android.intent.action.VIEW");
browserIntent
                    .addCategory("android.intent.category.LAUNCHER");
browserIntent
                    .addCategory("android.intent.category.BROWSABLE");
browserIntent.putExtra("create_new_tab", false);

browserIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

browserIntent.setData(Uri.parse("www.google.com"));
// browserIntent.setType("text/html");
browserIntent.setClassName("com.sec.android.app.sbrowser",
                            "com.sec.android.app.sbrowser.SBrowserMainActivity");

browserIntent.putExtra(
                    "com.android.browser.application_id",
                    "com.sec.android.app.sbrowser");

// browserIntent.setFlags(32768);
startActivity(browserIntent);

您可以嘗試添加com.android.browser作為包並刪除類名方法嗎?

Intent browserIntent = new Intent("android.intent.action.VIEW");
browserIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
browserIntent.setData(Uri.parse("www.google.com"));
browserIntent.setPackage("com.android.browser");
startActivity(browserIntent);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM