Using a html file project to access offline content from the app

Re: Using a html file project to access offline content from the app

by Sourabh Maheshwari -
Number of replies: 0

Hi Dani,

For our offline browsing app wo work without internet we recently worked on the webview in Android Studio and we faced the similar problem with intents there but with shouldoverrideURLLoading method we have it working without the problem. Here is the code:

public boolean shouldOverrideUrlLoading(final WebView mWebView, final String url) {
if (url.startsWith("intent://")){
final Intent intent= new Intent(Intent.ACTION_VIEW, Uri.parse(url));
intent.setPackage(packageName);
// The following flags launch the app outside the current app

intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
context.getPackageManager();
context.startActivity(intent);

return true;
}

return false;
}


Similar thing can be done in Iframe I suppose. I don't know coding as such so cannot find that out.

Thanks