+12 votes
1.3k views
in Android by (530 points)

Have you ever seen an application crashes and stops responding? Did you see the window that says that an application is not responding? These little things can occur if blocking the UI-thread for long.If something running on that thread takes too long (for example, network applications or database), the user may experience an episode of jankiness. 

 
How to protect yourself from this? 

1 Answer

+12 votes
by (4.4k points)
Use AsyncTasks and ThreadPoolExecutors to block calls to the worker threads is an option. When our background tasks are completed, we can use callbacks or message windows to show the results of the process in question. 
 
Overall, are enough applications that have one or more of the failures detailed herein. It is important to consider all of them. And although I have been a little on the surface of the problems, I hope the article helps to improve the operation and interface of any existing or future applications.
Ask a Question
Welcome to WikiTechSolutions where you can ask questions and receive answers from other members of the community.

You can ask a question without registration.

Categories

...