public class MyWebViewClient extends WebViewClient {?
@Override?
public boolean shouldOverrideUrlLoading(WebView view, String url) {?
if (url.startsWith("vnd.youtube:")){
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(i);?
List?list = getPackageManager().queryIntentActivities(i, PackageManager.MATCH_DEFAULT_ONLY);?
if (list.size() == 0) {?
i = new Intent(getApplicationContext(), YouTube.class);?
}?
return true;}?
else {?
return super.shouldOverrideUrlLoading(view, url);?
}?
}?
}?
详细解决方案
WebViewClient播发特定内容
热度:165 发布时间:2012-09-27 11:11:17.0