0

Hi i've problem with activities because i'm Newbie in Android i have two activities : when the first activity finishes, the second begins and the second activity are change in it's content elemnts


( This in the first "default" Activity )

@Override
protected void onResume() {
    // TODO Auto-generated method stub
    super.onResume();

        final Context context = this;
        AppPrefs appPrefs = new AppPrefs(context);
        String Last_Activity = appPrefs.getValue("Last_Activity");
         if(Last_Activity == "listV"){
             finish();
             Intent i = new Intent(this, NewClas.class);
             startActivity(i);



         }
}

when app is in background then i open it: every elements that had changed became as what it was ,

i mean that All changes returned as before

What I want is resume activity and appear it's changes that it was making when app was in background.

Sorry for my English i hope someone helps me Thanks a Lot ..

Ahmed Sabry
  • 434
  • 1
  • 8
  • 17

2 Answers2

2

Ahh.. Your If condition never become true,

It should be like,

 if(Last_Activity.equals("listV")){ ... }
user370305
  • 108,599
  • 23
  • 164
  • 151
1

You can use onSaveInstanceState() to save any values you want in a bundle and then restoring them in onRestoreInstanceState().

Nermeen
  • 15,883
  • 5
  • 59
  • 72