Android 6 - how to open Firefox from my app?

senglory

New member
Sep 30, 2016
2
0
0
In Android 4 & 5 the following code worked perfectly:
Code:
void shareImageWithUri(Uri uri) {
        Intent intent3 = new Intent(Intent.ACTION_MAIN, null);
        intent3.addCategory(Intent.CATEGORY_LAUNCHER);
        intent3.setComponent(new ComponentName("org.mozilla.firefox", "org.mozilla.firefox.App"));
        intent3.setAction("org.mozilla.gecko.BOOKMARK");
        intent3.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent3.putExtra("args", "--url=" + uri.toString());
        intent3.setData(uri);
        startActivity(intent3);
    }

It opened a FF instance and navigated the Firefox at the passed url. In Android 6 I am still getting the FF opened, but it does not recognize the passed url and therefore leaves the tab clean. How can I pass a url in app start arguments in Android 6?
 
Last edited by a moderator:
I moved this from the Marshmallow forum to the Software Development forum for more specific traffic.
 
Are you still running the same version of FF? Or are you running a slightly later version? The current version is 68. (and if you read Bugzilla, you'll see that there are hundreds of little problems, many getting fixed in the nightly, then being incorporated into the next minor update. [68.0.2 was yesterday.)

Try a toast or notification right after
Code:
("args", "--url=" + uri.toString()
just to see if the right URL is being sent. (Standard debugging technique - have the app tell you what's happening.)
 
I tried my app both with FF49 and with the latest one - the same effect, empty tab in FF. Meanwhile, Android 4.4 and 5.1 don't have such issue and open FF with my url.