title: what context should i use AlertDialog.Builder in?
body: <p>Could anyone please explain what context should i use the AlertDialog.Builder class? I am new to android app development and I frankly don't understand which context to use when?</p>
  
  <p>Say, I want to create an object for AlertDialog.Builder class - </p>
  
  <pre><code>AlertDialog.Builder ab = new AlertDialog.Builder();
  ab.setMessage("Test");
  
  ab.show();
  </code></pre>
  
  <p>What context should I use it in? Does it differ if I use the Alert Dialog <code>onCreate</code> or <code>OnClickListener</code> or in the handler of any such event? </p>