Android:从应用程序内启动Firefox

前端之家收集整理的这篇文章主要介绍了Android:从应用程序内启动Firefox前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
只是想知道是否有人知道启动Firefox移动浏览器的正确意图.我无法在任何地方找到它,所以我希望有人知道.
谢谢

解决方法

这将为Firefox创建一个意图:
  1. String url = "http://example.com/";
  2. Intent intent = new Intent(Intent.ACTION_MAIN,null);
  3. intent.addCategory(Intent.CATEGORY_LAUNCHER);
  4. intent.setComponent(new ComponentName("org.mozilla.firefox","org.mozilla.firefox.App"));
  5. intent.setAction("org.mozilla.gecko.BOOKMARK");
  6. intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  7. intent.putExtra("args","--url=" + url)
  8. intent.setData(Uri.parse(url));

猜你在找的Android相关文章