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.NullPointerException
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:465)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:666)
at com.comet.android.keyboard.util.Util.getBitmapDrawable(MyFile.java:416)
...
Here is my call to Drawable.createFromResourceStream()
drawable = Drawable.createFromResourceStream(context.getResources(), null, stream, null);
where context
a subclass of InputMethodService and stream
either is a FileInputStream or AssetInputStream (I've tried both). The resource file is a compiled NinePatchDrawable. I've confirmed that stream is not null.
To repeat: this bug only happens with certain HTC handsets (including the Evo) running various versions of Android OS.
Has anyone experienced this and/or know how to fix it?
Thanks in advance,
Barry
P.S. What is strange is that crash line 465 is not within crash method BitmapFactory.decodeResourceStream() in any version of BitmapFactory.java so HTC must be using modified code.