android - Refresh ListView from another activity -
i have 2 activities: "a" (my main activity listview) , "b" (is form showed dialog). when start "b" "a", need "a" not finished stay in background. then, when finish "b" need listview in "a" refreshes items. how can do? let me know if wasn't clear.
launch b activity startactivityforresult
, catch result in onactivityresult
. remember use unique code activity b when launched can check if response right one.
example
intent intent= new intent(this, activityb.class); startactivityforresult(intent, 1000); @override protected void onactivityresult(int requestcode, int resultcode, intent data) { if(requestcode == 100&&resultcode=result_ok) { myadapter.notifydatasetchanged(); } }
Comments
Post a Comment