【问题标题】:Define new scheme in the android textview with url使用 url 在 android textview 中定义新方案
【发布时间】:2010-12-22 14:41:53
【问题描述】:

您好,我尝试实现这样的东西,我在 listview 中有 textview,在 textview 中有类似 ("look:") 的字符串,我使它看起来像 Linkify 的链接,但我必须将其重定向到我的活动,以便 ("look:java") 将调用将重定向和搜索单词 java 的活动。我如何定义完成这项工作的新方案,只是询问如何定义新方案其他部分只是额外的信息。

【问题讨论】:

  • 方案标签用于编程语言。请从这个问题中删除它。
  • 好的,我编辑了这个问题,谢谢提醒

标签: java android android-intent textview


【解决方案1】:

你应该能够做到这一点:

<activity android:name="com.something.ActivityName">
    <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="look" />
    </intent-filter>
</activity>

见:http://developer.android.com/guide/topics/manifest/data-element.html

另外,您可能必须使用“look://something”而不是“look:something”

【讨论】:

  • 我一定会检查一下,这里是怎么回事(看:这里的字符串)可点击的部分是“这里的字符串”部分不包括在内,只要确保你做对了
猜你喜欢
  • 1970-01-01
  • 2016-01-30
  • 2011-04-30
  • 2011-12-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-10-30
  • 1970-01-01
相关资源
最近更新 更多