android-homebutton

Android: change default Home Application

我是研究僧i 提交于 2019-11-26 09:27:26
问题 for some specific requirement I am required to change Android Default Home application with my customized Home application ( a setting inside my app that will toggle default home = my application or previous home) I don\'t want the user to travel android settings that are very complicated. Can any one help me out like where it registers launcher.apk for default home application or how to change that The only thing I could find was that old question: How to change default Android's Desktop

Not able disable Home button on specific android devices

吃可爱长大的小学妹 提交于 2019-11-26 06:44:52
问题 I know this question has been asked many times and the answer is always \"No we cant disable home button\". I have a little different query to ask. I wrote simple code in which my activity overrides the onKeyDown() and return true for all key presses. In theory this means whoever opens the application is stuck there and has no option to move out of the application. When i tested this application on different devices, i made following observations : On motorola device with OS as 2.2.2 , Home

Android Overriding home key

柔情痞子 提交于 2019-11-26 04:27:48
问题 As the question suggests I know we can\'t override the Home key event but if you look into the emulator of android 2.2 you will see an application Car Home it has overridden most of the keys like Home, end call. Now, the point is how have they done it? I tried to peep into the source code of the app but to my surprise its not available or I am unable to find it, but I don\'t think later is the case. 回答1: I agree with @Romain Guy You can't override the behaviour of home button. What the Car

Display back button on action bar

試著忘記壹切 提交于 2019-11-26 03:48:02
问题 I\'m trying to display a Back button on the Action bar to move previous page/activity or to the main page (first opening). And I can not do it. my code. ActionBar actionBar = getActionBar(); actionBar.setHomeButtonEnabled(true); the code is in onCreate . 回答1: well this is simple one to show back button actionBar.setDisplayHomeAsUpEnabled(true); and then you can custom the back event at onOptionsItemSelected case android.R.id.home: this.finish(); return true; 回答2: I think onSupportNavigateUp()

How to disable the home key

血红的双手。 提交于 2019-11-26 00:54:03
问题 I\'d like to lock the screen. I want to disable the home key and only use the back key. How do I accomplish this? 回答1: Use this method to disable the Home key in android @Override public void onAttachedToWindow() { this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD); super.onAttachedToWindow(); } 回答2: I found a way to tackle the HOME key. For your application set the manifest as <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category

Detect home button press in android

霸气de小男生 提交于 2019-11-25 23:30:25
问题 This has been driving me nuts for a while now. Is there any way of reliably detecting if the home button has been pressed in an android application? Failing that, is there a robust way of telling what caused an activity to go into onPause? i.e Can we detect if it was caused by a new activity launching or by pressing back/home. One suggestion I have seen is to override onPause() and call isFinishing() but this will return false when pressing the home button just as it would if a new activity

How to disable the home key

隐身守侯 提交于 2019-11-25 19:02:18
I'd like to lock the screen. I want to disable the home key and only use the back key. How do I accomplish this? Use this method to disable the Home key in android @Override public void onAttachedToWindow() { this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD); super.onAttachedToWindow(); } amiekuser I found a way to tackle the HOME key. For your application set the manifest as <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android