How to exclude URLs with Android Intent Filters?

懵懂的女人 提交于 2020-03-01 05:17:50

问题


I saw some intent filters like this one.

<data android:scheme="http" 
      android:host="m.facebook.com" 
      android:pathPattern=".*"/>

Facebook app throws URLs like

http://m.facebook.com/l.php?u=http%3A%2F%2Fyoutu.be%2FBsKtRwSyLmM&h=9AQF5nU03&s=1

I want to open those urls that contain youtu.be but NOT user (as I want to open videos in the app not user profiles).


回答1:


I have been looking for something similar, and apparently you can only filter the actual path (in this case "l.php") and not the query string (u=http%3A...).

Here is a similar questions: intent filter pathPrefix with question mark

And a workaround (works only if you are looking for references to your own page): Android Browser Facebook Redirect Does Not Always Trigger Intent for URL



来源:https://stackoverflow.com/questions/16991764/how-to-exclude-urls-with-android-intent-filters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!