How to set result for activity in Android?
문제
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?
해결책
Call this on List Item Click Event.
Intent data = new Intent();
data.putExtra("SOMETHING", "EXTRAS");
setResult(RESULT_OK, data);
finish();
제휴하지 않습니다 StackOverflow