android-homebutton

overriding the Home Key Long press in a category.HOME activity

无人久伴 提交于 2019-12-17 11:14:11
问题 I just created my own "Home" to replace the stock android one or Sense. All is working fine and I get all I want. My only problem is to replace to long press on home key ( that usually show the last 6 activities you launched) by my own launcher. I successfully replace the long press on MENU button with this code: @Override public boolean onKeyDown(int keyCode, KeyEvent event) { //Log.i(TAG,"Keycode: "+keyCode); if (keyCode == KeyEvent.KEYCODE_MENU) { // this tells the framework to start

Android disable all hardware keys for lockscreen app

≯℡__Kan透↙ 提交于 2019-12-13 18:30:28
问题 I am coding a custom lockscreen app for android. I have managed to disable the back button. But the home button and the recent apps button on ICS proved not to be as easy. I searched around and came up with: @Override public void onAttachedToWindow() { // TODO Auto-generated method stub this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD); super.onAttachedToWindow(); } However, this throws IllegalArgumentException window type can not be changed after it is added. I then tried to

How to always open current activity on icon press , after pressing the home key of device

依然范特西╮ 提交于 2019-12-13 18:06:49
问题 I really having stuff with the Activity launch after press on home key.Suppose i have three A, B, C activity and i disable the back press on device. Suppose A is my main Launcher Activity and i move from A to B and B to C and pressed the home key and again click on icon then it always start A that is the launcher. But i did not want like that when press home key on C then click on icon should always start with C Activity. If i press home key on B Activity then always want to open B actvity on

How to block home button on Android 4.4?

佐手、 提交于 2019-12-13 07:33:00
问题 On Android 4.4 I develop a lockscreen app, but in lockscreen activity I can't block home button. Can anyone solve it? 回答1: Override the onKeyDown function of the activity and then catch the event for the home button. @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if ((keyCode == KeyEvent.KEYCODE_HOME)) { Toast.makeText(this, "You pressed the home button!", Toast.LENGTH_LONG).show(); return true; } return super.onKeyDown(keyCode, event); } 来源: https://stackoverflow.com

Android - clear the recent app list (shown after long HOME press)

北战南征 提交于 2019-12-12 11:27:10
问题 I'm writing a custom launcher app. The problem is even after setting it as default, the long press of HOME button brings recent app list, including old launcher. Is it possible to clear the recent app list? 来源: https://stackoverflow.com/questions/6723132/android-clear-the-recent-app-list-shown-after-long-home-press

clear application defaults

与世无争的帅哥 提交于 2019-12-12 08:14:52
问题 I am using category android:name="android.intent.category.HOME" category android:name="android.intent.category.DEFAULT" to override the HOME button behavior and point it to my application. On this particular tablet, i only want this custom application to run and for the average user not be able to exit out of it (ie. tablet at a museum exhibit ) I have a hidden sequence to trigger the close of the application super.onDestroy(); this.finish(); but it just opens back up because i have set it to

Android launcher press home in launcher to go to default screen

巧了我就是萌 提交于 2019-12-12 08:14:08
问题 In the default android launcher, pressing home while in another activity will start the launcher. Pressing home again while in the launcher will reset to the default home screen page. I don't understand how this can be done. Android sends the same intent whether the launcher is in the foreground or not. Home key also cannot be intercepted by user apps. Is there a way to achieve this? 回答1: Android sends the same intent whether the launcher is in the foreground or not. Correct. Home key also

How to enable the home button to return to a common activity?

陌路散爱 提交于 2019-12-12 01:22:50
问题 I use ActionbarSherlock and would like to enable the home button ... Therefore I call setHomeButtonEnabled(true) in my base activity. public class BaseFragmentActivity extends SherlockFragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { setTheme(R.style.Theme_Sherlock); super.onCreate(savedInstanceState); getSupportActionBar().setHomeButtonEnabled(true); // Here } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case

Change homeAsUpIndicator dynamically

北城余情 提交于 2019-12-12 00:28:33
问题 I build an app with four tabs and, as a consequence, four fragments. In the first fragment, I have a sliding menu and I throw with a custom icon in the actionbar. The problem is that in the others fragments, I want to stablish other custom icon to return to the first fragment but I don't know what to do... This is my styles.xml with my custom icon for the sliding menu: <!-- Application theme. --> <style name="AppTheme" parent="AppBaseTheme"> <item name="android:homeAsUpIndicator">@drawable

LaunchMode & Recent App Principle

。_饼干妹妹 提交于 2019-12-11 13:06:08
问题 I have a WidgetResultActivity and a NotificationResultActivity, I set both their launchmode=singleInstance. But they have different behaviors: WidgetResultActivity will not opened from RECENT, while NotificationResultActivity will always be opened from RECENT(It is opened alone! Without MainActivity). So How can I forbid NotificationResultActivity opening from REcent, thx. <activity android:name=".WidgetResultActivity" android:launchMode="singleInstance" android:theme="@android:style/Theme