0

I try to go to previous Activity (Activity A) but have problem. Command to this get inside Activity B and I wont to go back to B:

A:

if(...)
{
   B.staticF();
}

B:

static void staticF()
{
   super.onBackPressed();
}

But I can't use super because it's static context.

Of course, I can call

Intent i = new Intent(this, B.class);
startActivity(i);

but I wont to save B look.

Leo
  • 2,658
  • 5
  • 36
  • 59

1 Answers1

1

Why not just use something like a shared preference to save the state? and then use the intent to go back and in the onCreate method get the preferences and populate any views with the data you wanted to save

FabianCook
  • 18,692
  • 14
  • 59
  • 110