更新时间:2023-11-27 21:17:28
是的,因为这可以迫使你的应用程序始终开放原生的Android浏览器只。为此,您必须确定启动活动
的浏览器
应用程序,这样的事情:
Yes, for this you can force your application to always open native android browser only. For this you have to identify the launching Activity
of Browser
application, something like this:
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.google.android.browser","com.google.android.browser.BrowserActivity"));
intent.setAction("android.intent.action.VIEW");
intent.addCategory("android.intent.category.BROWSABLE");
Uri uri = Uri.parse(url);
intent.setData(uri);
try
{
startActivity(intent);
}
catch (Exception e)
{
e.printStackTrace();
}