Intentional result, how do you know who sent it?

Is it possible to find out which batch or process sent an Intent result?

Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);

I found a way to find out which applications are capable of processing this intention, but I also want to know which one is selected, or rather, the one that returns the result. Is it possible?

+5
source share
2 answers

It depends on how they are developed. Some applications return an Intent filled with material, other empty or null.

        @Override
        protected void onActivityResult(int requestCode, int resultCode, Intent i) {
         if (i!=null){        
            i.getPackage();
            i.getExtras();
            i.getData();
            i.getScheme();
            i.getType();
           }
        }

Try writing / reading all possible values ​​inside the Intent .

+1
source

Logcat. , . , , .

0

All Articles