When the my application launches for the first time after installation, it works good, but when the user relaunches it after closing, the application hangs on first activity for some time and runs slow, giving the Logs of purging from font cache, It happens only on first activity.
In the first activity, I am downloading strings and images from a web-service and showing the data in a TableLayout in dynamically created TableRow. I am using a custom font (Halvetica bold, if it matters) for showing data. The ScrollView in which I am putting the TableLayout, doesn’t scrolls on relaunching for few seconds and sometimes triggers the ANR.
I am using AsyncTask for downloading those data. Is there any way I can stop this purging or relaunch the activity as if it’s getting launched for the first time after installation??
When the my application launches for the first time after installation, it works good,
Share
I think I got this. The problem was I was using a static class, which was not getting reset and due to that the
TableRowwas getting piled up, affecting the performance.So I declared a new
reset()method in that static class and called it inonDestroy().Additionally I converted the whole
TableLayout+ScrollViewinto aListViewwhich has arecyclefeature. Now the application is working excellent.