Skip to content

Commit ad4b750

Browse files
Merge pull request #17 from mehmetakiftutuncu/master
Added More Schemes to WebView's URL Loading Override Check
2 parents c15bd16 + 4443d73 commit ad4b750

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/src/main/java/com/thefinestartist/finestwebview/FinestWebViewActivity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,12 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) {
10071007
if (url.endsWith(".mp4")) {
10081008
Intent intent = new Intent(Intent.ACTION_VIEW);
10091009
intent.setDataAndType(Uri.parse(url), "video/*");
1010+
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
1011+
view.getContext().startActivity(intent);
1012+
return true;
1013+
} else if (url.startsWith("tel:") || url.startsWith("sms:") || url.startsWith("smsto:") || url.startsWith("mms:") || url.startsWith("mmsto:")) {
1014+
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
1015+
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
10101016
view.getContext().startActivity(intent);
10111017
return true;
10121018
} else {

0 commit comments

Comments
 (0)