[android-developers] Re: Why does getPadding() of NinePatchDrawable throw a NullPointerException?

2009-10-13 Thread Anders
Ah! That works fine, thank you very much. As to why I was creating a NinePatchDrawable my self... I can only claim inexperience with the NinePatch classes. :) This is how it looks now, after your comments: Bitmap tagBalloonBitmap = BitmapFactory.decodeResource(getResources(),

[android-developers] Re: Why does getPadding() of NinePatchDrawable throw a NullPointerException?

2009-10-13 Thread Dianne Hackborn
I very very strongly recommend not creating a nine patch yourself; just use Resources.getDrawable() to create it. On Tue, Oct 13, 2009 at 12:02 AM, Anders sundman.and...@gmail.com wrote: Ah! That works fine, thank you very much. As to why I was creating a NinePatchDrawable my self... I can

[android-developers] Re: Why does getPadding() of NinePatchDrawable throw a NullPointerException?

2009-10-13 Thread Anders
I didn't know about that method, but that sounds like the right solution. I was kind of suspecting that there would be a cleaner solution to all of this. Thank you for your advice. // Anders On 13 Okt, 09:36, Dianne Hackborn hack...@android.com wrote: I very very strongly recommend not

[android-developers] Re: Why does getPadding() of NinePatchDrawable throw a NullPointerException?

2009-10-12 Thread Romain Guy
NinePatchDrawable tagBalloon9pDrawable = new NinePatchDrawable(tagBalloon9p); this creates a NinePatchDrawable with a null padding. That's why you get an NPE. You need to specify the padding. On Mon, Oct 12, 2009 at 10:07 AM, Anders sundman.and...@gmail.com wrote: I'm trying to use

[android-developers] Re: Why does getPadding() of NinePatchDrawable throw a NullPointerException?

2009-10-12 Thread Romain Guy
BTW, why are you creating the NinePatchDrawable yourself if you are creating it from a resource anyway? On Mon, Oct 12, 2009 at 3:01 PM, Romain Guy romain...@google.com wrote: NinePatchDrawable tagBalloon9pDrawable = new NinePatchDrawable(tagBalloon9p); this creates a NinePatchDrawable with a