MyWebViewClient.shouldOverrideUrlLoading in app/src/main/java/org/olgsoft/apipepanic/MainActivity.java forwards every URL the embedded game page navigates to with a plain startActivity(Intent.ACTION_VIEW, ...):
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
return true;
}
The call is unguarded. If the device has no installed app that handles the URI scheme of the link the page tries to open, startActivity throws ActivityNotFoundException and tears the Activity down mid-game.
This is reachable today on:
- Tablets / TVs / form factors that ship without a default browser.
- Stripped-down GSI / custom ROM builds where the browser has been removed.
- Users who have manually disabled their browser via
pm disable.
The fix is local: wrap the startActivity call in try / catch (ActivityNotFoundException) and show a Toast so the failure stays scoped to that single click. Happy to open a PR.
MyWebViewClient.shouldOverrideUrlLoadinginapp/src/main/java/org/olgsoft/apipepanic/MainActivity.javaforwards every URL the embedded game page navigates to with a plainstartActivity(Intent.ACTION_VIEW, ...):The call is unguarded. If the device has no installed app that handles the URI scheme of the link the page tries to open,
startActivitythrowsActivityNotFoundExceptionand tears the Activity down mid-game.This is reachable today on:
pm disable.The fix is local: wrap the
startActivitycall intry / catch (ActivityNotFoundException)and show a Toast so the failure stays scoped to that single click. Happy to open a PR.