从Android浏览器将数据传递到外部应用程序 [英] Passing data from Android Browser to external app
问题描述
这是我需要做的:
我有一个应用程序在后台运行。现在,当用户浏览,并遇到一个有趣的URL,他可以打个手势,并发送URL到外部应用程序。该应用程序,然后对其进行处理。
I have an app running in the background. Now when the user is browsing and comes across an 'interesting' URL, he can make a gesture and send the URL to the external app. The app then processes it.
我能想到这样做(虽然我不知道如果任一可能的话)的双向
1.程序类似的东西感应特定手势或按键preSS和发送URL到应用程序的钩子
I can think of two way of doing this(though I am not sure if either is possible) 1. Program something like a hook that senses the particular gesture or key press and sends the URL to the app
- 写一样的东西添加到浏览器中。
我的问题是,任何这种可能。如果是的话,你可以给我一些提示,这样我可以继续。如果没有,那么有没有任何其他的方式做到这一点?
My question is, is any of this possible. If yes, could you give me a few hints so that I can go ahead. If not, then is there any other way to do it?
谢谢,
的Sandip
Thanks, Sandip
推荐答案
看看WebViewClient.shouldOverrideUrlLoading。它应该允许在加载新的URL,你得到通知。
Take a look at WebViewClient.shouldOverrideUrlLoading. It should allow you to be notified when a new URL is loaded.
<一个href=\"http://developer.android.com/reference/android/webkit/WebViewClient.html#shouldOverrideUrlLoading%28android.webkit.WebView,%20java.lang.String%29\" rel=\"nofollow\">http://developer.android.com/reference/android/webkit/WebViewClient.html#shouldOverrideUrlLoading%28android.webkit.WebView,%20java.lang.String%29
这篇关于从Android浏览器将数据传递到外部应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!