title: How to reproduce Application Not Responding (ANR) from Activity and from BroadcastReceiver
body: <p>I need to reproduce Application Not Responding (ANR) dialogs from Activity and from BroadCastReceiver.
  I tried to create a simple button click:</p>
  
  <pre><code> public void makeANRClick(View view){
      while (true);
  }
  </code></pre>
  
  <p>With this code I reproduced ANR on emulator with android 2.3.7. Same code doesn't work on real device with the newest android versions (4+).</p>
  
  <p>Another attempt was as follows:</p>
  
  <pre><code>public void onMakeANRClick(View view){
      try {
          Thread.sleep(15000);
      } catch (InterruptedException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>This doesn't help also.
  Any suggestions?</p>