使用Intent在Firefox for Android中打开URL

问题描述 投票:1回答:1

通常,我们可以使用此意图在Chrome中打开一个URL:

startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("googlechrome://navigate?url=http://google.com")))

但是,我怎么能用Firefox for Android实现同样的目的呢?有什么像firefox://navigate?url

android google-chrome firefox android-intent intentfilter
1个回答
0
投票

你可以尝试下面的代码

 Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
 intent.setComponent(new ComponentName("org.mozilla.firefox","org.mozilla.firefox.App"));
 this.startActivity(intent);
© www.soinside.com 2019 - 2024. All rights reserved.