Conversation
// redraw the image by invalidating the container | ||
imageGetter.container.invalidate(); | ||
// re-set text to fix images overlapping text | ||
imageGetter.container.setText(imageGetter.container.getText()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what this change does? I was under the impression that the order of these method calls matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's attempt to avoid ArrayOutOfBoundException, but I not sure that it's help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, can you make these two commits two separate pull requests? I will definitely merge the OutOfMemory fix, the other one needs more testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, no problem. This is stacktrace for ArrayOutOfBoundException, may be it's help:
Fatal Exception: java.lang.ArrayIndexOutOfBoundsException: length=116; index=852
at android.text.MeasuredText.addStyleRun(MeasuredText.java:168)
at android.text.MeasuredText.addStyleRun(MeasuredText.java:204)
at android.text.StaticLayout.generate(StaticLayout.java:281)
at android.text.DynamicLayout.reflow(DynamicLayout.java:284)
at android.text.DynamicLayout.<init>(DynamicLayout.java:170)
at android.widget.TextView.makeSingleLayout(TextView.java:5999)
at android.widget.TextView.makeNewLayout(TextView.java:5897)
at android.widget.TextView.checkForRelayout(TextView.java:6436)
at android.widget.TextView.setText(TextView.java:3703)
at android.widget.TextView.setText(TextView.java:3561)
at android.widget.TextView.setText(TextView.java:3536)
at org.sufficientlysecure.htmltextview.HtmlHttpImageGetter$ImageGetterAsyncTask.onPostExecute(HtmlHttpImageGetter.java:123)
at org.sufficientlysecure.htmltextview.HtmlHttpImageGetter$ImageGetterAsyncTask.onPostExecute(HtmlHttpImageGetter.java:79)
at android.os.AsyncTask.finish(AsyncTask.java:631)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5108)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:751)
at dalvik.system.NativeStart.main(NativeStart.java)
Great thanks |
I added optimizable fixes, for bugs that i got in production