开发者

How can I set an icon for my custom mimetype

开发者 https://www.devze.com 2023-02-23 02:01 出处:网络
I have created a new mimetype, it works very well with file browser, and it open my activity, but it displayed as unknown icon on file browser, I use ASTRO file browser.

I have created a new mimetype, it works very well with file browser, and it open my activity, but it displayed as unknown icon on file browser, I use ASTRO file browser. I have added开发者_开发百科 an icon for the intent, but it still appears as unknown icon this is my code

    <activity android:name=".SharedActivity" android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter android:icon="@drawable/icon" android:label="swv">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
        <intent-filter android:icon="@drawable/icon" android:label="swv">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="http" />
            <data android:host="*" />
            <data android:pathPattern=".*\\.swv" />
        </intent-filter>
        <intent-filter android:icon="@drawable/icon" android:label="swv">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="http" />
            <data android:host="*" />
            <data android:mimeType="application/swv" />
        </intent-filter>
        <intent-filter android:icon="@drawable/icon" android:label="swv">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="file" />
            <data android:host="*" />
            <data android:pathPattern=".*\\.swv" />
        </intent-filter>

    </activity>


Try putting the icon on the <activity> element, instead of (or in addition to) on the <intent-filter> elements.

0

精彩评论

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