如果用户点击文件浏览器中的特定文本文件(如深层链接),我想打开我的活动。 这是我的代码
<activity
android:name=".debug.DebugActivity"
android:label="@string/debug_label"
android:screenOrientation="portrait">
<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="file" />
<data android:host="*/*" />
<data android:pathPattern =".*\\.txt" />
<data android:host="*" />
</intent-filter>
</activity>
我该怎么做? 在此先感谢
答案 0 :(得分:0)
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:mimeType="text/html" />
<data android:mimeType="text/plain" />
<data android:mimeType="application/xhtml+xml" />
</intent-filter>
我用这个
得到了解决方案