I have 5 EditText and there is a button, on clicking of that button it brings the user to the next Activity where user can see some information and after the user seen the information he cancel that activity and go back to first activity. But at this time the values entered in the Edittext is removed. So I want to remain that values on coming back to the previous Activity.
Asked
Active
Viewed 683 times
0
-
1Can you post your activity code. – InnocentKiller Mar 19 '14 at 12:47
3 Answers
0
on the Button click of first activity start new activity without finishiing it and on the second activity click back button click finish your current activity this will bring your first activity on resume state
First Activity on click of button:
mBtnNext.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(ActivityFirst.this,ActivitySecond.class));}
});
Second Activity Button Click:
mBtnBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();}
});

jyomin
- 1,957
- 2
- 11
- 27
0
There is different way to this Task But one of Them is You can use Shared Preference
In Shared preference Store your Edit Text value . When You come back to Your First
Activity from Second activity Fetch Edit text value from Shared preference and Print that
value in Edit text.
Thank You.

user3173387
- 41
- 6