How to set result for activity in Android?
Question
I have a ListActivity
that is started with startActivityForResult
by a PreferenceActivity
.
On ListItemClick
, I want to return with a result to my PreferenceActivity
.
How do I do this? When will onActivityResult
be called?
La solution
Call this on List Item Click Event.
Intent data = new Intent();
data.putExtra("SOMETHING", "EXTRAS");
setResult(RESULT_OK, data);
finish();
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow