home-button

override Home key in android ICS

浪尽此生 提交于 2019-11-29 12:44:40
I need to override HOME key in my application. I've used code from this post but it's not working on android 4.X. Do you know other workarounds to achieve this task? I've looked a little bit in native Phone application (on android 2.2) but I couldn't find where is the code that overrides HOME button, but I've searched for text "TYPE_KEYGUARD" in all project and my ide couldn't find anything, which makes me think that there is another way to suppress HOME key. Any ideas? Swayam Post ICS i.e. Android 4+, the overriding of the HomeButton has been removed for security reasons, to enable the user

How to enable a 'kiosk mode' programmatically in ipad?

廉价感情. 提交于 2019-11-28 23:52:34
I'm making an application that needs users' complete attention till a specified target is achieved. before achieving the target, if a user tries to press 'home' button it should be disabled, or like 'kiosk mode' in ios6. I just needed to be done programmatically while start the application, dont like to do anything by manually changing in settings menu in iPhone/iPad After completion of target in my application, home button should be enabled. The application is targeted for enterprise. So no need for app store approval. How to do this? thanks in advance. Edit: I read about "mobile

Overriding the functionality of Home Button

家住魔仙堡 提交于 2019-11-28 10:17:40
问题 In android I have been able to override the functionality of back button very easily but for my app I need to override the home button . For example the user is in Activity A , when he presses the home button, activity B is launched . I have tried to do the following but it failed. @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_HOME) { startActivity(new Intent(this, ActivityB.class)); return true; } return super.onKeyDown(keyCode, event); } I

How to enable a 'kiosk mode' programmatically in ipad?

走远了吗. 提交于 2019-11-27 21:26:44
问题 I'm making an application that needs users' complete attention till a specified target is achieved. before achieving the target, if a user tries to press 'home' button it should be disabled, or like 'kiosk mode' in ios6. I just needed to be done programmatically while start the application, dont like to do anything by manually changing in settings menu in iPhone/iPad After completion of target in my application, home button should be enabled. The application is targeted for enterprise. So no

Disable Home button in Android 4.0+

雨燕双飞 提交于 2019-11-27 09:35:29
I'm trying to replace the stock lock screen with my own app. In my code, i want to disable the Home button. I know how to do this in Android 2.3 and below, but the same code doesn't work with Android 4.0+ (return to desktop when Home button pressed) Recently I found out an app called MiHome which has its own lock screen and is able to disable the Home button. Does anyone know how it achieves this??? There is no way to intercept the home button on Android, unless you make your app the home screen. This is for security reasons, so that malicious apps cannot take over your device by overriding

block Home Button in Ice cream sandwich and jelly bean

谁说我不能喝 提交于 2019-11-27 08:08:35
I am developing Lock screen where i want to disable Home button in ice cream sandwich and in Jelly bean , i can block it using following methods in android 2.2 , 2.3 @Override public void onAttachedToWindow() { // TODO Auto-generate method stub this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD); super.onAttachedToWindow(); } also tried this getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); Here i am also not getting event info via onPause Method or onKeyDown But these methods done't work for me in ICS,Jelly bean if is there any method that can replace it then

block Home Button in Ice cream sandwich and jelly bean

跟風遠走 提交于 2019-11-26 14:02:55
问题 I am developing Lock screen where i want to disable Home button in ice cream sandwich and in Jelly bean , i can block it using following methods in android 2.2 , 2.3 @Override public void onAttachedToWindow() { // TODO Auto-generate method stub this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD); super.onAttachedToWindow(); } also tried this getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); Here i am also not getting event info via onPause Method or onKeyDown

Override Power button just like Home button

柔情痞子 提交于 2019-11-26 11:40:47
Well, I am doing something in which I want to disable all hard buttons of the device. Hard buttons like Power, Home, Volume up, Volume down, Search, Back. I have successfully overridden almost all buttons here except Power. So I just want you people to see and please share some ideas so that I get can away with it. I am getting the long press Power keyevent in onDispatchKeyEvent() , in the same way I want to catch the short click of the same. Moreover when pressing power I also tried to stop Screen off by getting the Broadcast of SCREEN_OFF and I succeeded in receiving it but I was not able to