Search code examples
androidintentfilter

return to filemanger/gallery after sharing a image to my app


i am using intent-filter to share images to my application. the uploading Activity is (B) and the main Activity in my app is (A). so the images sent from filemanger/gallery to Activity (B) then the user click upload and i kill the (B) Activity with

    finish();

and i am using

    onActivityResult()

method to check if the user came from the uploading Activity and end the main Activity (A) with the finish() function. now i killed my app but the system take the user to the home or the apps list. i want the system take the user back to the filemanger or the gallery to share more photos.


Solution

  • i had to add a attribute to the Activity in the manifest file you have to change the way of lunching the Activity add this code in the Activity tag

            android:launchMode="singleTask"
    

    more info : http://developer.android.com/guide/topics/manifest/activity-element.html#lmode