我的应用有一个WebView开口this webpage。
您所看到的网页上有一个橙色的大按钮,用于打开Ing bank应用(如果已安装)。
英格银行应用程序确实已安装在我的手机中。
我的代码:
private fun openExternalApp(url: String) {
LOG.d(TAG, "Opening external app: $url")
try {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
finish()
} catch (e: ActivityNotFoundException) {
println(e)
}
}
日志:
2019-05-14 14:50:47.159 D/WebViewActivity: Opening external app: intent://bankieren.ideal.ing.nl/ideal/betalen/inlog-annuleren/static/detect_mob?trxid=435435&random=345345#Intent;scheme=https;package=com.ing.mobile;end;
--------- beginning of system
2019-05-14 14:50:47.161 I/ActivityManager: START u0 {act=android.intent.action.VIEW dat=intent://bankieren.ideal.ing.nl/ideal/betalen/inlog-annuleren/static/detect_mob?trxid=57657&random=657556} from uid 10171
2019-05-14 14:50:47.181 D/WebViewActivity: hostAllowedForInPageResource() ideal.ing.nl
令人惊讶的是,以下作品为什么起作用?
adb shell am start -n com.ing.mobile/.app.activities.SplashActivity -d "intent://bankieren.ideal.ing.nl/ideal/betalen/inlog-annuleren/static/detect_mob?trxid=234234&random=456456#Intent;scheme=https;package=com.ing.mobile;end;"
/system/bin/sh: end: not found
Starting: Intent { dat=intent://bankieren.ideal.ing.nl/ideal/betalen/inlog-annuleren/static/detect_mob?trxid=0020002390865596 cmp=com.ing.mobile/.app.activities.SplashActivity }