I want to make a confirm function in java just like a alert in javascript
.
Example javascript code:
var a = prompt("");
In java i have a function that returns a string with a dialog box input;
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;
}
But my application don't respond. What should i do. I want to pause
androidPrompt()
while showMyDialog()
is not done. and when showMyDialog()
is done androidPrompt()
function will resume and return the value