Android: launching Firefox from an application

just wondering if anyone knows the right intention to launch Firefox Mobile Browser. I can’t find him anywhere, so I was hoping someone here would find out. Thanks

+6
source share
2 answers

This will create the intent for 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)); 
+8
source

Try this code:

  Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); intent.setComponent(new ComponentName("org.mozilla.firefox", "org.mozilla.firefox.App")); this.startActivity(intent); 
+3
source

Source: https://habr.com/ru/post/900810/


All Articles