通常,我们可以使用此意图在Chrome中打开一个URL:
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("googlechrome://navigate?url=http://google.com")))
但是,我怎么能用Firefox for Android实现同样的目的呢?有什么像firefox://navigate?url
?
你可以尝试下面的代码
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
intent.setComponent(new ComponentName("org.mozilla.firefox","org.mozilla.firefox.App"));
this.startActivity(intent);