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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -