Is there any confirmed solution to running mp4, 3gp or mp3 files via webView? I finally have my code working
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.endsWith(".mp3")) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(url), "audio/*");
view.getContext().startActivity(intent);
return true;
} else if (url.endsWith(".mp4") || url.endsWith(".3gp")) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(url), "video/*");
view.getContext().startActivity(intent);
return true;
} else {
return super.shouldOverrideUrlLoading(view, url);
}
}
however the line:
return super.shouldOverrideUrlLoading
is returning the error: " The method shouldOverrideUrlLoading(WebView, String) is undefined for the type Activity"
I simply cannot find a solution for this anywhere and I'm sure I've done a great job building this project given that I've only been learning Android for the past 6 weeks.