开发者

How to open an android app via intent filter?

开发者 https://www.devze.com 2023-02-02 01:25 出处:网络
I am trying to open a file with my app and to receive a file via the SEND intent. I\'ve tried several filters in the manifest file but coul开发者_C百科d not get it to be displayed anywhere.

I am trying to open a file with my app and to receive a file via the SEND intent. I've tried several filters in the manifest file but coul开发者_C百科d not get it to be displayed anywhere. How is this done?

        <activity
            android:name=".MyActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action
                    android:name="android.intent.action.MAIN" />
                <category
                    android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <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:mimeType="*" /> 
<data android:host="*" />
            </intent-filter>
        </activity>
0

精彩评论

暂无评论...
验证码 换一张
取 消