Reputation: 476
Trying to make something similar to facebook chat head. When we click on the chat head it opens up the chat. Now when we press back button it closes the popup of chat. How to capture onBackPressed event in a service?
Upvotes: 0
Views: 1784
Reputation: 4702
You can use this library here to make floating windows like facebook chat heads. This library's floating windows closes on back button press.
Upvotes: 1
Reputation: 993
This might work :
make the window or view you show via service as focusable, add a onKeylistener(for e.g. on rootview or other) and listen for KEYCODE_BACK.
Upvotes: 1