adrianrdzv
adrianrdzv

Reputation: 125

How to show a PopoupWindow at the click location?

I'm trying to show in Android a PopupWindow at the click location. I read that Android does not support getting the click coordinates for some reason.

I want to do something like the little popup that appears on the contacts on Android 2.1+ when you select a person's icon and a window appears at the row location showing different options to contact that person. Also in the twitter application they do something similar.

I guess it is acting more like a Context Menu, but what I read is that Context Menus cannot be customized. How are this popup windows at location done?

Thanks.

Upvotes: 0

Views: 2454

Answers (1)

adrianrdzv
adrianrdzv

Reputation: 125

There is an easier option for the case of PopupWindow:

The method showAsDropDown(View, int offsetx, int offsety) of the PopupWindow will anchor the window to the given view by the specific offset.

Upvotes: 1

Related Questions