我希望我的某项活动能够获取特定网址。该模式是:Android - 匹配url模式?
http://www.example.com/abc123/foo/xyz789
路径组件 “ABC123” 和 “xyz789” 可以是字母数字的任何序列,长度> 1.
在我的清单这样做:
<activity>
<intent-filter>
<action
android:name="android.intent.action.VIEW" />
<category
android:name="android.intent.category.DEFAULT" />
<category
android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="http"
android:host="example.com"
android:pathPattern="/.*/foo/.*" />
但似乎从我的域中的任何模式得到匹配,即:
myexample.com
myexample.com/whatever
都得到匹配。我想也许这个。*操作符不能像我期望的那样工作?任何帮助将是巨大的,
感谢
http://developer.android.com/guide/topics/manifest/data-element.html
您好,感谢您的信息,这两个群体将是不同的(更新Q可反映)。我们可以使用。+运算符吗?这似乎仍然匹配everthing:pattern =“/.+/foo/.+” – user291701 2011-01-21 22:40:47
您引用的文档没有提及“。+”。 – 2011-01-21 22:55:18