tags:

views:

159

answers:

1

Is it possible to obtain the X-Y coordinates of a home screen widget? I need to display a pop-up relative to the position of the widget, so I need to get the X and Y coordinates.

Thank you

+2  A: 

It's part of the Intent used when clicking a widget. Just call getSourceBounds() on the Intent used to launch your Activity.

Romain Guy
Great ... I took me a while to figure out that this method is only available in framework 2.1 and later. Thanks
alejom99