---
title: "WHAT IS AN ANR? WHICH STRATEGIES CAN YOU USE TO AVOID IT?"  
description: "WHAT IS AN ANR? WHICH STRATEGIES CAN YOU USE TO AVOID IT?"  
author: "Tushar singh"  
published: 2018-01-23  
canonical: https://answers.mindstick.com/qa/33515/what-is-an-anr-which-strategies-can-you-use-to-avoid-it  
category: "technology"  
tags: ["android"]  
reading_time: 2 minutes  

---

# WHAT IS AN ANR? WHICH STRATEGIES CAN YOU USE TO AVOID IT?

WHAT IS AN [ANR](https://www.mindstick.com/interview/2565/what-is-anr)? WHICH [STRATEGIES](https://www.mindstick.com/articles/85697/most-important-onboarding-strategies-for-office-employees) CAN YOU USE TO [AVOID](https://yourviews.mindstick.com/view/88515/common-mistakes-in-computer-integration-to-avoid) IT?

## Answers

### Answer by Arti Mishra

**ANR (Application Not Responding)**An ANR (Application Not Responding) happens when some long operation takes more time in the "main" thread. To prevent from ANR you have to make long task on other threads. ![WHAT IS AN ANR? WHICH STRATEGIES CAN YOU USE TO AVOID IT?](https://answers.mindstick.com/questionanswer/54c2885a-a235-4750-af01-71c8c36bc933/images/1e2db7d4-15c1-42c7-862d-afc80357a82b.png)In our android app when UI threads are blocked for long duration of times then ANR (Application Not Responding) event is triggered. If your app is in the foreground state and any process is running for long duration of times then the system internally display a dialog to the user. The ANR dialog boxes give the message to the user to facially quit the app. ![WHAT IS AN ANR? WHICH STRATEGIES CAN YOU USE TO AVOID IT?](https://answers.mindstick.com/questionanswer/54c2885a-a235-4750-af01-71c8c36bc933/images/43a66426-08f5-45d9-b087-cf0f11ea0ca3.png)\
When our UI component are updated on the main thread and process the user inputs, then causing frustration to the user in this case ANR create a problem. **\****Strategies to avoid ANR** When main thread is block while waiting for the child thread to complete our task then that cases you can’t call Thread.wait() or Thread.sleep() method for avoiding ANR. Instead of when child thread are blocked then main thread provide a handler for child threads to post back our competition. \


---

Original Source: https://answers.mindstick.com/qa/33515/what-is-an-anr-which-strategies-can-you-use-to-avoid-it

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
