i just wanna start any simple app in a kiosk mode, that is whenever i reboot i want only the app to be started nothing else. So researching a bit i found home replacement app, and disabling the home, menu search and back button. i tried some links about home replacement, but couldnt succeed. so please help if anyone can. thanks I tried changing the intent filter with this..ando
Asked
Active
Viewed 1.1k times
2
-
6"couldnt succeed" is not a useful description of your problem. – CommonsWare Sep 13 '13 at 16:32
-
ohh actually it did not execute at all. the app just force closed everytime.. and im new to the site.. so thank you for ur suggestion ... – Varun Barve Sep 13 '13 at 16:40
2 Answers
2
The simplest method is to make your app a launcher. Therefore as soon as the device loads or the users presses the home button your app will be shown.
You would need to add the following to your Android Manifest for your main activity that you want to be shown at startup/home key press
<activity android:name=".MainActivity"
...
android:launchMode="singleInstance"
android:stateNotNeeded="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Hope this helps

Boardy
- 35,417
- 104
- 256
- 447
-
Thanks a lot. it helped .. can u please give any link or code for disabling the home, search, menu and back button ?! thanks again for the help !! – Varun Barve Sep 13 '13 at 16:38
-
you cant disable the home or menu button, search will only do something if you want it to and you can easily search for back handling in android yourself. – Eluvatar Sep 13 '13 at 16:40
-
As @Eluvatar said you can't disable the home and menu button but why would you want to, the user won't be able to get out of your app if it is a launcher, same with the back button it can't leave your app as it is a launcher – Boardy Sep 13 '13 at 17:47
-
the thing is its a form kinda thing and if i press back or home button accidently wouldn't it restart the app and reset the form ??! – Varun Barve Sep 13 '13 at 18:59
-
I don't believe it would, the home button and back button will only do something if the user was taken to a different activity within your app, although you can't block the home button, you can control the back button, http://stackoverflow.com/questions/6489059/how-to-control-hardware-back-button might help, you could the answer in this question but not actually do anything,although I don't believe this would be required – Boardy Sep 14 '13 at 13:05
-
@VarunBarve : Check my answer in this link to disable the status bar on a rooted android tablet : http://stackoverflow.com/questions/11958034/hide-tablet-system-bar/ – Basher51 May 03 '14 at 02:15