android-homebutton

Can we add a counter when home button is clicked in android?

不问归期 提交于 2019-12-24 05:56:15
问题 I know that home button cannot be stopped or override. Is there a way to extend the home button in a way then when it is click, my counter should be increasing without disturbing any functionality of the home button. 回答1: Try the following code, it works: HomeWatcher mHomeWatcher = new HomeWatcher(this); mHomeWatcher.setOnHomePressedListener(new OnHomePressedListener() { @Override public void onHomePressed() { // do something here... } @Override public void onHomeLongPressed() { } });

Android custom launcher (Like toddler lock)

懵懂的女人 提交于 2019-12-23 04:58:07
问题 I am making a children's app and I would like to add a child lock to it, just like the one on the app called "Toddler lock". Toddler lock asks you to set the default launcher when the lock is turned on which allows the home button to be disabled. How would I do this? 回答1: Ok so ive got a rough working example here: Create two activities and two layouts, in the main layout place a normal button. The other layout can just have a blank <LinearLayout> . This is what my manifest looks like:

android launcher page on the menu

强颜欢笑 提交于 2019-12-20 06:47:49
问题 I'm running my android app on my droid x2 device. this app has a menu with some items, one of which is the Home (the screen that launches when the app starts). the problem is that when I tap on the Home item it brings up this menu, I don't know why it does that and how i can fix it. It works fine on the simulator, I'm gussing this is something that needs to be set up on the device. I need to know if some has seen this menu before and if so what it is and when it shows up? 回答1: I actually fix

Intercepting home button on Android

空扰寡人 提交于 2019-12-20 04:13:10
问题 I've researched this a lot and it seems that after ICS normal applications can no longer intercept the Home Button. However, I see apps like Go Locker that are able to trap the Home Button. If Go Locker isn't intercepting the home button, what are they doing to prevent the user from going to the home screen? 回答1: You cannot intercept the home button. You cannot disable it. The way how the go locker does it is by drawing its layout over other apps. It requires extra permission. See this link

Enable home button ActionbarSherlock, Sherlockfragment

偶尔善良 提交于 2019-12-19 19:39:45
问题 I want to enable the home button in my fragment. This question is asked earlier but for an activity. I tried ... getSupportActionBar().setDisplayHomeAsUpEnabled(true); ... but this doesn't work. Here is my code: import com.actionbarsherlock.R; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.ActionBar.Tab; import com.actionbarsherlock.app.SherlockFragment; import com.actionbarsherlock.view.MenuItem; import android.support.v4.app.Fragment; import android.content

How to disable the background color when HomeUp is pressed?

天涯浪子 提交于 2019-12-19 04:10:28
问题 Background: I currently enable the HomeUp button on Activity , thanks to: getSupportActionBar().setDisplayHomeAsUpEnabled(true); According to the Documentation, it's related to setHomeButtonEnabled which: Enables or disables the "home" button in the corner of the action bar [...] Setting the constant DISPLAY_HOME_AS_UP display option (setDisplayHomeAsUpEnabled method) will automatically enable the home button. Also, I customize with a selector the state background of items in ActionBar with

Android - How to exit an app when user press the home button?

一笑奈何 提交于 2019-12-19 04:08:27
问题 I want to know how to exit an app when user press the Home Button. As far as i know that Home Button moves the running app in background and puts Launcher process in front. I know i can use finish() but i don't know where i should call it because i have no idea which function is going to get a call when user will press the Home Key. Thanks. 回答1: Depending on what you want to do, overriding onUserLeaveHint might be the best bet: http://developer.android.com/reference/android/app/Activity.html

Android: How to control the home button

久未见 提交于 2019-12-19 03:45:43
问题 We're trying to provide an application to the mentally and physically handicapped daughter of my neighbor that let's her use an Android tablet as a Talker, i.e., she presses a few big buttons and the devices generates speech. The application is basically a WebView and an additional object in Javascript used to perform and control the speech generation, plus some logic to handle the orientation changes. Html files are generated offline for her specific layout of the talking items. We've also

Android: How to control the home button

人走茶凉 提交于 2019-12-19 03:45:23
问题 We're trying to provide an application to the mentally and physically handicapped daughter of my neighbor that let's her use an Android tablet as a Talker, i.e., she presses a few big buttons and the devices generates speech. The application is basically a WebView and an additional object in Javascript used to perform and control the speech generation, plus some logic to handle the orientation changes. Html files are generated offline for her specific layout of the talking items. We've also

How to prevent custom home launcher app restart activity?

隐身守侯 提交于 2019-12-18 04:23:07
问题 I am working on my own home launcher replacement and it works fine but one thing bothers me. When I press a home key, current home activity (the one defined in manifest as main/defualt/launcher/home) restarts - current activity instance onpause is executed and oncreate is fired again, so new activity is brought up. On the other hand, ADW launcher and LauncherPRo does not behave like that - I do not a refresh like in my case. Launcher Pro even can do several actions: If you are on the main