i learn about android chat-head, i see many of example of it,but i not got answers of how to remove chat head using any event,i want to create chat-head like Facebook-messenger, many of example of floating-window useful to me to create that,but any one please help me to how to remove chat-head, for example in Facebook-messenger we put chat-head in bottom ,one cross automatic open in bottom through that we can remove chat-head.
Asked
Active
Viewed 2,017 times
3
-
Nirav please provide the solution for the question – jyomin Dec 16 '15 at 10:18
-
have you got any solution? – Ram Oct 14 '19 at 06:50
1 Answers
3
You need to simply call
windowManager.removeView(yourView);
to remove whatever view has been added as a ChatHead. For the close button you need to override the onTouch behaviour. Although I don't have any ready sample for this but I would suggest you to make a close button on your Chathead . When the user clicks on the close button you can remove the view from window manager

Ajit Pratap Singh
- 1,299
- 12
- 24
-
some where i got solutions but when i try to call it when my new activity start at that time i got error **java.lang.IllegalArgumentException: View not attached to window manager** – Nirav Mehta Aug 12 '14 at 09:47
-
-
Are you sure that your view was added before you called removeView() – Ajit Pratap Singh Aug 12 '14 at 10:06
-
-
Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/59174/discussion-between-ajit-pratap-singh-and-nirav-mehta). – Ajit Pratap Singh Aug 12 '14 at 10:21