Hi i have broadcast application and I have a floating window
purpose: to view this window every activity I visit.
so my goal is that to minimize my floating window when I user press home button
SO my question is is there any way to detect if home is press?
if yes please guide me into it.
thanks in advance.
Pss.. I also tried to search it on this website but seems I haven't found a solution yet on it.
Note: it should be on service not in activity
Related
I want to launch app when we press the volume button long time up or down button.When activity is not visible and app is present in background i.e in recent apps.Is there any solution for that. I am new to android so please help me to resolve this problem.
Just look for broadcast receiver on android developer site. You will get goo explanation with example.
Hi My service displays a system alert window which displays on top of all other activities similar to how facebook displays chatheads on top of other activities. This is done using WindowManager.
My problem is that I need to remove it when user presses the home button and so far I am struggling to find a way to detect home button that would work on Android Lollipop.
Any pointers would be appreciated.
Thanks
It is impossible to detect and/or intercept the HOME button from within an Android app. This is built into the system to prevent malicious apps that cannot be exited.
It's a bad idea to change the behavior of the home key. This is why Google doesn't allow you to override the home key.
You may refer this LINK for more info/discussion.
I want to know how to press the back button when a button is clicked in a service in android.
I want to make a program like assistive touch assistant in samsung phones..
Please help me!
First of all, there are no back buttons in a service. A service does not have a UI. If you mean an activity, just call finish().
how to make an activity in specific app(security app) started when pressing (menu or any other of the device buttons), what i should do?, i'm already have BroadcastReceiver in my app(to read SMS).
I'm new to android, so from where i should start? Please help me.
Edit: In my phone(Samsung) if i press too long on menu button one of google apps started(launched).
According to the official Android documentation (http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_HOME): Key code constant: Home key. This key is handled by the framework and is never delivered to applications.
I am looking for a way to disable the task manager window once I long press on the home button.
I managed to disable other device keys (such as volume, menu etc) and the normal click on the home button as I am the default launcher, but I don't know how to disable the task manager!
Even Toddler Lock kids app show u the task manager screen following long click, so I assume it isn't easy to do so.
I saw few answers say I shouldn't disable the task manager, but I want to have it from another key instead the long click on home button.
If needed and will solve my problem, I can be rooted.
Please help.
I found a way to do so with Android 2.3.5:
Override home and back button is case a boolean is true
(I used the piece of code from hotveryspicy)
But, as written in this link, this solution isn't working with Android 4.0.3
Can u help me to find a solution for 4.0.3 as well?
To avoid the recent app dialog on the long click home button, you can listen on focus of your activity. When your activity is loosing focus, fire an Intent.ACTION_CLOSE_SYSTEM_DIALOGS intent.
Sample code here: http://www.juliencavandoli.com/how-to-disable-recent-apps-dialog-on-long-press-home-button/
I hope this will help you :)