-3

Can you help me to get the following steps :

  1. When user click on the button Home:
  2. It display a screen that contains a message Action not allowed.
  3. This screen is displayed for a few seconds.
  4. Then User will be redirected to MainActivity.

I work with 4.1.1 Android version so I can't override Home button.

vjdhama
  • 4,878
  • 5
  • 33
  • 47
Afef
  • 19
  • 4

1 Answers1

0

Use a new activity which contains your Action not allowed message, redirect the user to is. Then, in it, you can set a Timer with your waiting time and redirect the user to MainActivity. Check out android doc about timer here : http://developer.android.com/reference/java/util/Timer.html

Rogue
  • 751
  • 1
  • 17
  • 36
  • Thanks for help @Rogue but my problem is how to redirect when click on Home button not with timer – Afef May 18 '14 at 15:04
  • Oh, didn't see it that way. You can't catch input on home button, refer to this answer for further details : http://stackoverflow.com/questions/9972166/how-to-listener-homebutton-in-android – Rogue May 18 '14 at 15:12
  • Yes, it not works because you can't catch click on home button. – Rogue May 18 '14 at 15:26
  • But I know several app with home button disabled like Kids Place application for example – Afef May 18 '14 at 15:30