문제

I have my android app which gets all installed applications via - queryIntentActivities .

and I need to be able to add my own activity to this list, so I can start it, when this activity is picked, How can I do it?

Thank you on advance.

도움이 되었습니까?

해결책

Implement an <intent-filter> on your <activity> which matches the Intent that you are creating. Something akin to:

        <intent-filter>
            <action android:name="android.intent.action.SEND"/>
            <action android:name="android.intent.action.SEND_MULTIPLE"/>
            <data android:mimeType="???"/>
            <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>

(where ??? would be replaced by whatever APP_DEFALUT_MIME_TYPE is, I guess)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top