views:

43

answers:

2

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.

A: 

I should have searched more in stackoverflow... There is a sample in this question: http://stackoverflow.com/questions/3113106/how-to-make-twitter-app-style-quick-actions-on-android

And also here is a guide: http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/

adrianrdzv
A: 

There is an easier option for the case of PopupWindow:

The method showAsDropDown(View, int offsetx, offsety) of the PopupWindow will anchor the window to the given view by the specific offset. Hope this helps to anyone having the same problem.

adrianrdzv