android url重定向

时间:2012-03-01 21:36:57

标签: android intentfilter

我有如下链接。

确切网址

 <a href="activity_a://lookup/gelismeler">gelismeler</a>den 
在textview中,我使用上面的链接启用了链接,我想打开特定的活动。但是,我得到了

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=activity_a://lookup/gelismeler (has extras) }

我的清单xml包含

下面的行
 <intent-filter>
                        <action android:name="android.intent.action.VIEW" />
                        <action android:name="android.intent.action.DEFAULT" />

                        <category android:name="android.intent.category.BROWSABLE" />

                        <data
                            android:host="lookup"
                            android:scheme="activity_a" />
                    </intent-filter>

所以这里有什么问题?如何打开重定向到myactivityname:// functionname / parameters to myactivity =&gt;的链接? function =&gt;带参数..

提前致谢

编辑:进行了一些更改。到@CommonsWare的建议

2 个答案:

答案 0 :(得分:1)

步骤1:摆脱LOOKUP,因为没有这样的行动。

步骤2:添加<category android:name="android.intent.category.DEFAULT" />,因为我没有在TextView使用BROWSABLE中链接这些链接。

步骤3:保持你的方案小写,因为我认为这是方案的要求。

答案 1 :(得分:0)

http://android-developers.blogspot.com/2009/11/integrating-application-with-intents.html

这是自定义意图过滤器的一个很好的指南...