vendredi 8 mai 2015

onActivityResult() called prematurely while calling Settings activity

I'm facing the known issue onActivityResult getting called immediately.

I read the reason behind it on some link

where it is advice to change launch mode of called activity.

But in my case I'm starting(navigating to) settings activity, to let the user enable data connection.

startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS),
                            Constants.REQUEST_ENABLE_DATA_CONNECTION);

So I can't change launch mode of Settings activity.

I tried setting some flags to Intent e.g. intent.setFlags(0); but its not working.

Aucun commentaire:

Enregistrer un commentaire