android app通过webview打开其他app
2017-03-13 13:42
676 查看
我们通过webview打开那些不是http等开头的链接,会报找不到网址的问题。而如果我们想要通过那些链接打开外部app的话,就需要在方法里面加判断了。如果有其他方法,请留言...
对了,记得打开其他app时要判断手机是否安装该app,否则会蹦。
对了,记得打开其他app时要判断手机是否安装该app,否则会蹦。
public boolean shouldOverrideUrlLoading(WebView view, String url) { Log.d("test","webactivity..url:"+url); if(!url.startsWith("http")) { Log.d("test","非http开头..url:"+url); Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(url)); boolean isInstall = getPackageManager().queryIntentActivities(intent,PackageManager.MATCH_DEFAULT_ONLY).size()>0; Log.d("test","是否安装要跳转的app:"+isInstall); if(isInstall) { startActivity(intent); finish(); } return true; } web.loadUrl(url); return true; }
相关文章推荐
- Android Webview无法播放美拍网或者优酷网视频,其他视频没问题解决办法。(网页可能暂时无法打开或已永久移至新地址)
- Android通过Chrome Inspect调试WebView的H5 App出现空白页面的解决方法(不需要FQ)
- android WebView常用属性,调起其他app
- android:如何通过chrome远程调试APP中的webView的h5代码
- Android webview支持type="file" 打开相机和相册,支持小米(亲测6.0通过)
- android 通过设置cookie解决app 登录后WebView还要重新登陆问题
- android通过webview调起支付宝app支付
- Android 通过点击浏览器或者内部WebView加载URL 唤起App
- 解决android WebView无法唤起其他app
- Android通过WebView在线打开PDF文件
- android通过webview调起支付宝app支付
- 用webview构建能打开微信支付宝支付、自动跳转域名的Android H5APP
- Android 真机,微信打开 H5,切换到 webview,能通过 webdriver 方法操作页面元素,然后链接到新的 H5 页面后,无法操作元素,appium 服务器没有收到 response,
- 通过Appium获取Android app中webview
- android通过webview调起支付宝app支付
- Android 通过包名打开其他APP
- android通过webview调起支付宝app支付
- Android开发 WebView新窗口中打开链接
- Cocos2d-x游戏开发之Cocos2dx通过JNI调用Android的Java代码(webView实例)
- Android中通过Java获取Webview加载内容