0

enter image description here enter image description here

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

Beginner
  • 4,118
  • 3
  • 17
  • 26
  • According to me. You can't get the home key event from services. But you can get some Idea from [here](https://stackoverflow.com/questions/8881951/detect-home-button-press-in-android/8883447#8883447). – UltimateDevil Sep 16 '17 at 01:46
  • bro did you see this https://developer.android.com/reference/android/app/Activity.html#onUserLeaveHint() – Vij Sep 16 '17 at 04:27
  • @Vij it works but it also trigger whenever I start a new activity :( also I am handling a service not an activity – Beginner Sep 16 '17 at 05:36

0 Answers0