android - How to implement the call back mechanism between Activites -
i have 2 activities first details activity , second activity page confirmationpage,once confirm should come first page,how should handle scenario?
is possible between activities,instead of using fragments?
you have use startactivityforresult(); method when start secondactivity.
and have implement onactivityresult() method.
here code first activity..
@override protected void onactivityresult(int requestcode, int resultcode, intent data) { // todo auto-generated method stub super.onactivityresult(requestcode, resultcode, data); if (resultcode == 1) { bundle = data.getextras(); string id = extra.getstring("namekey").trim(); // code here. } } code in second activity..
add code on confirm click button.
intent = new intent(); bundle = new bundle(); extra.putstring("namekey", keyvalue); i.putextras(extra); setresult(1, i); finish();
Comments
Post a Comment