Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/core/ui/web-view/index.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ function initializeWebViewClient(): void {

// Handle schemes like mailto, tel, etc
if (!android.webkit.URLUtil.isNetworkUrl(url)) {
openUrl(url);
return true;
return openUrl(url);
}

return false;
Expand Down
8 changes: 8 additions & 0 deletions packages/core/utils/index.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ export function openUrl(location: string): boolean {
const context = ad.getApplicationContext();
try {
const intent = new android.content.Intent(android.content.Intent.ACTION_VIEW, android.net.Uri.parse(location.trim()));
const packageManager = context.getPackageManager();

intent.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK);

// Handle schemes like mailto, tel, etc
if (intent.resolveActivity(packageManager) == null) {
Comment thread
prabudevarrajan marked this conversation as resolved.
Resolved
Trace.write('Unable to open ' + location + '. Make sure to add queries element(https://developer.android.com/guide/topics/manifest/queries-element) matching the scheme to the AndroidManifest.xml file.', Trace.categories.Error, Trace.messageType.error);
return false;
}

context.startActivity(intent);
} catch (e) {
// We Don't do anything with an error. We just output it
Expand Down