How to get the data from “share picture via” dialog on Android?

前端 未结 2 1330
别那么骄傲
别那么骄傲 2020-12-17 04:24

I\'ve added the intent-filter. And when I tap \"share\" in the Gallery, it will launch my activity.

        
            

        
相关标签:
2条回答
  • 2020-12-17 04:34

    I found the answer.

    Uri imageUri = (Uri) getIntent().getExtras().get(Intent.EXTRA_STREAM);
    
    0 讨论(0)
  • 2020-12-17 04:41

    You can put data in Intent with intent.putExtra(..) and get data with intent.getXyzExtra(..) where xyz dependt on the type: can be String, int, array, etc..

    Check the Intent docs.

    0 讨论(0)
提交回复
热议问题