mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 12:03:28 +08:00
CB-8588 Add CATEGORY_BROWSABLE to intents from showWebPage openExternal=true
This commit is contained in:
parent
af2969dec5
commit
747d2c97cd
@ -232,10 +232,12 @@ public class CordovaWebViewImpl implements CordovaWebView {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
|
// To send an intent without CATEGORY_BROWSER, a custom plugin should be used.
|
||||||
|
intent.addCategory(Intent.CATEGORY_BROWSABLE);
|
||||||
|
Uri uri = Uri.parse(url);
|
||||||
// Omitting the MIME type for file: URLs causes "No Activity found to handle Intent".
|
// Omitting the MIME type for file: URLs causes "No Activity found to handle Intent".
|
||||||
// Adding the MIME type to http: URLs causes them to not be handled by the downloader.
|
// Adding the MIME type to http: URLs causes them to not be handled by the downloader.
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
|
||||||
Uri uri = Uri.parse(url);
|
|
||||||
if ("file".equals(uri.getScheme())) {
|
if ("file".equals(uri.getScheme())) {
|
||||||
intent.setDataAndType(uri, resourceApi.getMimeType(uri));
|
intent.setDataAndType(uri, resourceApi.getMimeType(uri));
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user