سؤال

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