drawable

How to draw text on canvas?

Hi, i'm trying to develop a simple pie chart class for android. For now, it can take a map of labels and values and draw the pie chart. I'm yet to add the legends for the pie, which is where i need to place the texts near small rectangles on the screen corner. Any help appreciated, since i'm new to Android dev. Thanks. ...

Unexplained NullPointerError when referencing drawable on API < 8

I have an app that works as intended when run on API 8, but when I run it on any older API version, it crashes with: 10-28 12:10:50.755: ERROR/AndroidRuntime(1864): Uncaught handler: thread main exiting due to uncaught exception 10-28 12:10:50.765: ERROR/AndroidRuntime(1864): java.lang.RuntimeException: Unable to start activity Componen...

android: changing a divider with setDivider in a ListActivity without a custom ListView?

I can't seem to get a customized divider, using a Drawable I've defined, to work when using a ListActivity and not creating a custom ListView. It almost seems like when the VM creates its own ListView for me, with the ListActivity, it uses a theme with the default divider provided; and if I try to provide one, no dividers appear in the ...

Android Drawable mutate() & setLevel()

Hi, I am trying to store drawables in a static SoftReferenceMap for a ListView containing progress-bars in every row. Every row has a different progress, but when I set it through setProgress(int) all rows get affected. I tried doing mDrawable.mutate().setLevel(progress*10000/max), but it still doesn't work. public void setProgres(int...

Drawing multiple shapes with ShapeDrawable in xml with Android

Hi, I am currently drawing a number of circles on a canvas in a custom view in code. the circles are static and do not change. I would like to draw them using a ShapeDrawable in xml to help clean up my code. I will have a number of different drawables which the user can select and therefore I don't want to do this in code. having 3 or 4...