I have a widget with an ImageView on it. I set this ImageView to a Bitmap created from a 9-patch PNG resource. The image is set correctly but is not stretched correctly - i.e. the whole image is stretched instead of just part like defined in my 9-patch PNG. If I just set the 9-patch image as a resource, it works. How can I fix this?
// Does not work (9-patch does not display correctly)
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.someNinePatch);
remoteViews.setImageViewBitmap(R.id.someImageView, bitmap);
// Works (9-patch displays correctly)
remoteViews.setImageViewResource(R.id.someImageView, R.drawable.someNinePatch);