I'm trying to use NinePatchDrawables in a LayerDrawable, but for some
reason I get a NullPointerException. I've isolated the problem to the
getPadding() method; the following code reproduces the problem:

Bitmap tagBalloonBitmap = BitmapFactory.decodeResource(getResources(),
R.drawable.balloon);
NinePatch tagBalloon9p = new NinePatch(tagBalloonBitmap,
tagBalloonBitmap.getNinePatchChunk(), null);
NinePatchDrawable tagBalloon9pDrawable = new NinePatchDrawable
(tagBalloon9p);

Rect r = new Rect();
tagBalloon9pDrawable.getPadding(r);  <<-- Throws NullPointerException!

What am I missing? Do I have to do anything special with the
NinePatch? The program seems to work if I use the NinePatch directly
(instead of putting it in a LayerDrawable).

Any suggestions and help is greatly appreciated.

// Anders

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to