开发者

My android application lags when i switch screens

开发者 https://www.devze.com 2023-04-04 14:36 出处:网络
When i open one of my screens for the fist time, there is lag, but afte开发者_如何学编程r it has been opened and i switch it runs smoothly. Is there a way to load the all the images before the app sta

When i open one of my screens for the fist time, there is lag, but afte开发者_如何学编程r it has been opened and i switch it runs smoothly. Is there a way to load the all the images before the app starts so that it doesn't lag the first time i switch to those screens?


You should load them asynchronously in a background thread and then update the display. You can upadte UI separately for each picture downloaded. Take a look at AsyncTask.


Consider using a splash screen. So when the user first start the app something will be on the screen and use the AsncTask if you need to fetch any resources or do any background process.

0

精彩评论

暂无评论...
验证码 换一张
取 消