Re: [android-developers] NullPointerException android.graphics.Bitmap.createBitmap(Bitmap.java:468)

2012-05-15 Thread naseem Rafique
Try following code. if (b1 == null) { return null; } Paint p = new Paint(); p.setAntiAlias(true); p.setAlpha(150); byte[] chunk = b1.getNinePatchChunk(); Bitmap b2 = Bi

[android-developers] NullPointerException android.graphics.Bitmap.createBitmap(Bitmap.java:468)

2012-05-14 Thread viktor
Please help me with exception. I have single resources folder. /res/drawable I create a custom button from one of the resource with some color effect. This works for ldpi, hdpi, xdpi devices, but when I run an app on the mdpi device it crashes. My code: Bitmap b1 = BitmapFactory.decodeResourc