Trouble getting height of OverlayItem Drawable

Posted by Bloudermilk on Stack Overflow See other posts from Stack Overflow or by Bloudermilk
Published on 2010-03-19T10:20:57Z Indexed on 2010/04/06 4:43 UTC
Read the original article Hit count: 276

Filed under:

Hey-

I'm having some trouble getting a hold of the drawable a certain OverlayItem is using so I can calculate the height of it and properly offset the note that shows onTap. Here is my code to try to get that drawable:

Drawable marker = item.getMarker(android.R.attr.state_focused);
if (marker != null) int markerHeight = marker.getIntrinsicHeight();

marker ends up null.

I'm using a drawable XML file with a selector for the different states of the OverlayItem's drawable. In it I'm specifying a drawable for the null state, state_focused, and state_pressed.

Thanks for any help!

-Nick

© Stack Overflow or respective owner

Related posts about android