I need to launch firefox mobile within my application. I'm currently doing this:
String url = "http://www.google.it";
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setComponent(new ComponentName("org.mozilla.firefox_beta",
"org.mozilla.firefox_beta.App"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setData(Uri.parse(url));
startActivity(intent);
And it works if firefox is not running. While if it is running (paused in background) this code just bring firefox up without loading the url I specified in the code.
This works for me:
adb shell am start -a android.intent.action.VIEW -n org.mozilla.firefox_beta/.App -d 'http://www.mozilla.org'
Try changing your:
Intent intent = new Intent(Intent.ACTION_MAIN, null);
to
Intent intent = new Intent(Intent.ACTION_VIEW, null);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With