Reputation: 6143
Problem: I am attempting to display an image inside of an ImageView and then perform computation while this image is displayed. This is supposed to loop through multiple times.
Instead, the ImageView does not update until all computation is done, and LogCat displayed "Skipped xxxx amount of frames! The application may be doing too much work on its main thread."
Question: How do I force the thread to pause the computation such that it updates the ImageView and doesn't skip any frames?
Things I have tried:
`myImageView.setImageBitmap(myBitmap);`
`myImageView.invalidate();`
`myImageView.setVisibility(ImageView.INVISIBLE);`
`myImageView.setVisibility(ImageView.VISIBLE);`
Any help or guidance would be appreciated!
Upvotes: 0
Views: 257
Reputation: 2976
Computation that takes more than 16ms has to be run in different thread than UI/main thread. You do not need to force to show image, you already do it right.
Upvotes: 1