Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android home screen widget x-y coordinates

Tags:

android

widget

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

like image 281
alejom99 Avatar asked Aug 09 '10 23:08

alejom99


1 Answers

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

like image 152
Romain Guy Avatar answered Sep 30 '22 13:09

Romain Guy