android - How to notify an activity that another activity is finished -
this newbie question. how make sure function in activity called when activity b finishes? can't put code activity b finishes, wondering if there way this. looked solution , found broadcasting don't know how that. know of simple solution this? thanks.
use startactivitityforresult
onactivityresult
pair.
activitya:
intent = new intent(this, activityb.class); startactivityforresult(i, 1);
activityb:
intent intent = new intent(); intent.putextra("result",result); setresult(result_ok,intent); finish();
activitya:
protected void onactivityresult(int requestcode, int resultcode, intent data) { // here acivityb finished. call method }
Comments
Post a Comment