It will be an ugly hack, but you can try the following:
Put a static variable called lastStopped in a subclass of the application (or any singleton, for that matter). Set to null by default.
In onCreate of your first action, you will have something like this:
if (MyApp.lastStopped != null) { Intent intent = new Intent(this, MyApp.lastStopped.getClass()); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(intent); finish(); return; }
Now, any action that you want to return after clicking on the house should have:
@Override protected void onStop() { super.onStop(); MyApp.lastStopped = this; }
Make sure you clear MyApp.lastStopped when you run another action to prevent a memory leak.
Let me know if this works for you, it was for me!
source share