java.lang.ArrayIndexOutOfBoundsException網頁視圖方法shouldOverrideUrlLoading: 在com.example.fragments.Hot $ 4.shouldOverrideUrlLoading(Hot.java:197)在com.android.webview.chromium.WebViewContentsClientAdapter .org位於org.chromium.base的org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(AwContentsClientBridge.java:352)上的org.chromium.android_webview.AwContentsClient.shouldIgnoreNavigation(AwContentsClient.java:168).shouldOverrideUrlLoading(WebViewContentsClientAdapter.java:357)。在android.os.Handler.dispatchMessage(Handler.java:102)處的android.os.Looper.loop處的org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:41)處的SystemMessageHandler.nativeDoRunLoopOnce(本地方法:0) Looper.java:148)at android.app.ActivityThread.main(ActivityThread.java:7406)at java.l com.android.internal.os.ZygoteInit上的ang.reflect.Method.invoke(Native Method:0)在com.android.internal.os.ZygoteInit.main(ZygoteInit.java)上的$ MethodAndArgsCaller.run(ZygoteInit.java:1230) :1120)java.lang.ArrayIndexOutOfBoundsException:使用機器人
這裏是我的代碼:
hot_webview.setWebViewClient(new WebViewClient()
{
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
String checkurl = url;
String[] separated = checkurl.split("=");
String splitted=separated[1];
Log.i("iaminh", " shouldOverrideUrlLoading called");
boolean installed = appInstalledOrNot(splitted);
if(installed)
{
Intent LaunchIntent = getActivity().getPackageManager()
.getLaunchIntentForPackage(splitted);
startActivity(LaunchIntent);
hot_webview.loadUrl(Hot_url);
} else
{
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri
.parse(market_url + splitted)));
hot_webview.loadUrl(Hot_url);
} catch (ActivityNotFoundException anfe)
{
startActivity(new Intent(
Intent.ACTION_VIEW,
Uri.parse(playstore_url + splitted)));
hot_webview.loadUrl(Hot_url);
}
}
return false;
}
});
後期片段代碼 –
請分享全部代碼 –
我編輯我的問題,請再次審查。 –