title: How to make Alert, Prompt and confirm dialog of javascript in java Android
body: <p>I want to make a confirm function in java just like a alert in <code>javascript</code>.</p>
  
  <p><strong>Example javascript code:</strong>
            <code>var a = prompt("");</code></p>
  
  <p>In java i have a function that returns a string with a dialog box input;</p>
  
  <pre><code>      public static boolean log ;
        public String value;
          public String androidPrompt(){
                log = true;             
                showMyDialog();
                while(log){
                }
                return value;
  
          }
  
  
         public void showMyDialog(){
            log= false;
             value = //inputed value from dialog; 
         }
  </code></pre>
  
  <p>But my application don't respond. What should i do. I want to pause 
  <code>androidPrompt()</code> while <code>showMyDialog()</code> is not done. and when <code>showMyDialog()</code> 
  is done <code>androidPrompt()</code> function will resume and return the value </p>