I am preparing a small app that requires authentication. In my main activity I have a Is it possible to do this? Start your child activity with: In your child activity, block your back button and add your data: and parcelable class called "user", which includes the user's username and password, when a user clicks on a button, a new user who passes through that user category Activity begins. It works like a charm in child activity, fill out the form to authenticate the user, then when the user clicks the back button, I would like to send the "user" class back to their main activity.
Start (Initial, 1);
@OnRead public at BACKPressed () {intent data = new intent (); Data.putExtra ("key", your datahare); SetResult (activity. RESULT_OK, data); Super.onBackPressed (); Get data inside internal activity inside
onActivityResult
disable zero activation usage on security raid (int requestcode, integer result, Intent data) {super.onActivityResult (requestCode, resultcode, data); If (requestCode == 1 & amp; amp; amp; resultcode == activity. RESULT_OK) {DataType yourData = (DataType) data.getParcelableExtra ("key"); // whatever you want with your data}}
No comments:
Post a Comment