[AC-1367] TiDrawableReference.getBitmap(true) fails on the second retry (android)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Cannot Reproduce |
Resolution Date | 2014-06-12T04:40:39.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | android, mobilesdk |
Reporter | grebulon |
Assignee | Ritu Agrawal |
Created | 2014-05-26T07:48:19.000+0000 |
Updated | 2016-03-08T07:37:47.000+0000 |
Description
There's a bug in
TiDrawableReference.getBitmap(true)
Calling BitmapFactory.decodeStream(is, null, opts)
the second time in the retry loop fails because the input stream (is
) has to be rewound.
At the beginning of the retry loop, you need to add something like:
{noformat}
if (i > 0)
is = getInputStream();
{noformat}
and also make sure that it is not null.
Thank you for your suggestion but we need a simple test case to reproduce this issue.
This is not a suggestion - it is a BUG report. Just find a huge image on the internet (search for very high resolution world map) and load it into an image view. You need to cause an out of memory exception. Or you can manually insert code to simulate this. I gave you a very good description of the problem and how to solve it, this should be enough. I don't have time to write your unit tests for you.
We have not been able to reproduce this issue and the reporter has declined to provide a test case.