I\'ve released an IME (soft keyboard) app and I am getting crash reports from HTC phones only. Here is the stack trace:
java.lang.NullPointe
Found a solution for this problem, you can replace the call to Drawable.createFromResourceStream
with:
// set options to resize the image
Options opts = new BitmapFactory.Options();
opts.inDensity = 160;
Drawable drawable = null;
Bitmap bm = BitmapFactory.decodeFile(file.getAbsolutePath(), opts);
if (bm != null) {
drawable = new BitmapDrawable(context.getResources(), bm);
}
This only works with files.