0

I am designing android application using tabHost.

TabActivity is always being launched from anther activity( suppose, Activity A). After that Activity A has no use.

When I am on tabActivity & if back button is pressed, then all goes in background( like every app). Now using task manager when I start app again, I want to retain tabActivity as it was. (like home button.) But currently I am getting Activity A. (as with back Button activities are getting destroyed.)

In short, I want to override backButton similar to Home Button.

I tried without luck with moveTaskToBack(true).

Can anybody suggest solution?

userx
  • 806
  • 1
  • 11
  • 23
  • http://stackoverflow.com/questions/2000102/android-override-back-button-to-act-like-home-button – sootie8 Jan 28 '14 at 14:21

1 Answers1

0

Also you could try this which should make the back button into a home button.

@Override public void onBackPressed() { this.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_HOME)); }

sootie8
  • 48
  • 3