Android:从应用程序内部启动Firefox

Android:从应用程序内部启动Firefox,android,firefox,android-intent,android-activity,Android,Firefox,Android Intent,Android Activity,只是想知道是否有人知道启动Firefox移动浏览器的正确意图。我到处都找不到,所以我希望这里有人知道。 谢谢这将为Firefox创建一个目标: String url = "http://example.com/"; Intent intent = new Intent(Intent.ACTION_MAIN, null); intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.setComponent(new ComponentName("org

只是想知道是否有人知道启动Firefox移动浏览器的正确意图。我到处都找不到,所以我希望这里有人知道。
谢谢

这将为Firefox创建一个目标:

String url = "http://example.com/";
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setComponent(new ComponentName("org.mozilla.firefox", "org.mozilla.firefox.App"));
intent.setAction("org.mozilla.gecko.BOOKMARK");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("args", "--url=" + url)
intent.setData(Uri.parse(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);

为什么特别是Firefox?为什么不是一般的“浏览器”意图?如果用户没有FF怎么办?你不能启动浏览器吗?在手机上,如果您将Firefox设置为默认浏览器,则应启动Firefox。这是用于商业销售应用程序的,因此它们将始终在同一平板电脑上运行,使用相同的浏览器。现在我有了浏览器选择器,但这有点烦人,我想进一步简化它。我一直在做的是穆罕默德关于设置默认浏览器的建议。谢谢。我再也不需要启动firefox了,但这很有效!