使用Intent在Firefox for Android中打开URL

使用Intent在Firefox for Android中打开URL,android,google-chrome,firefox,android-intent,intentfilter,Android,Google Chrome,Firefox,Android Intent,Intentfilter,通常,我们可以使用以下意图在中打开URL: startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("googlechrome://navigate?url=http://google.com"))) 但是,我怎样才能实现同样的目标呢?是否有类似firefox://navigate?url?您可以尝试下面的代码 Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); int

通常,我们可以使用以下意图在中打开URL:

startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("googlechrome://navigate?url=http://google.com")))
但是,我怎样才能实现同样的目标呢?是否有类似
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);
你可以试试下面的代码

 Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
 intent.setComponent(new ComponentName("org.mozilla.firefox","org.mozilla.firefox.App"));
 this.startActivity(intent);
Intent-Intent=newintent(Intent.ACTION_视图,Uri.parse(url));
setComponent(新组件名(“org.mozilla.firefox”、“org.mozilla.firefox.App”);
这一点。触觉(意图);
Intent-Intent=new-Intent(Intent.ACTION\u视图,Uri.parse(url));
setComponent(新组件名(“org.mozilla.firefox”、“org.mozilla.firefox.App”);
这一点。触觉(意图);

哪款Firefox适用于Android?有几个。不过,我怀疑Mozilla是否使用了这样的定制方案。@commonware这是哪款Firefox Android版?有几个。不过,我怀疑Mozilla是否使用了这样的自定义方案。@Commonware这段代码可能会回答这个问题,提供了关于这段代码为什么和/或如何回答这个问题的附加上下文,从而提高了它的长期价值,而这段代码可能会回答这个问题,提供关于此代码为什么和/或如何回答此问题的其他上下文,可以提高其长期价值