How to open Firefox about:reader?url=example.com with Intent on Android

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


How to open Firefox about:reader?url=example.com with Intent on Android



I'm a trying to open a webpage on an android application, the url sheme is a bit special it has to open an url in reader mode : about:reader?url=example.com


about:reader?url=example.com



I am doing it this way


Uri intentUri = new Uri.Builder().encodedPath("about:reader")
.appendQueryParameter("url", Uri.encode("example.com"))
.build();

// Try to open in Firefox If available or use default
Intent intent=new Intent(Intent.ACTION_VIEW);
intent.setData(intentUri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setPackage("org.mozilla.firefox");

try {
getApplicationContext().startActivity(intent);
} catch (ActivityNotFoundException ex) {
intent.setPackage(null);
getApplicationContext().startActivity(intent);
}



And i get E/AndroidRuntime: FATAL EXCEPTION: main



Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=about:reader?url=http://example.com


Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=about:reader?url=http://example.com



Is there a way to achieve this ?









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

vOji4Y4K6jTqgn7Hz8yKVyzmpcSXxbDgaUTmEe L6l xnQaYUxL Ad,KddqqsJLX5hlNHve 7necxT
uk k35xhyQp3MYoxxA2fEhwgSdFpluWcd0YT7TgZKqACUm KDnLq A BW hiICoPUUwP Tn,Cxb,jZV9PQcZ7uBpe5NgHU1s79D,CJB09E

Popular posts from this blog

Makefile test if variable is not empty

Will Oldham

Visual Studio Code: How to configure includePath for better IntelliSense results