i want to show a custom popup menu when user click on a floating icon
the float icon create with an service and i have no activity
this is my floating icon c
PopupWindow can only be attached to an Activity. In your case you are trying to add PopupWindow to service which is not right.
To solve this problem you can use a blank and transparent Activity. On click of floating icon, launch the Activity and on onCreate of Activity show the PopupWindow.
On dismiss of PopupWindow, you can finish the transparent Activity.
Hope this helps you.