Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I detect if user selected from createChooser options?

Tags:

android

I have a code that will prompt user to send a message by selecting the desired application, how can I detect if the user actually have chose from the options or instead pressed Back?

I tried to check if the intent returned something, but is running asyncronous so cannot be tracked.

Also I have tried to run the intent with startActivityForResult, what I noticed in onActivityResult that resultCode is always 0(RESULT_CANCELED) even if user selected, or not from the chooser.

like image 526
Pentium10 Avatar asked Jul 20 '10 08:07

Pentium10


1 Answers

From Android's source, you can see that the Activity that chooses among Intents doesn't setResult() at all. That should be requested as a feature.

like image 193
ognian Avatar answered Nov 26 '22 06:11

ognian