joe dacoolguy
joe dacoolguy

Reputation: 309

How to wait for a response after a certain command?

Here is a line of code that I have:

public class ReminderHandler()  {
  if (edittext.containsReminderWords()){
  test.setText("Do you want me to remind you to " + sharedPref.getString(toremember, toremember) + "?");
    }
}

I want the program to wait for either a yes or a no answer from the edittext after this specific line of command.

I have no idea how though.

How can I achieve this?

Upvotes: 0

Views: 71

Answers (3)

dilusha manjari
dilusha manjari

Reputation: 81

JOptionPane has plenty of options for you to use.

JOptionPane.showConfirmDialog(null, "Do you want to do something?")

See here for the documentation

Upvotes: 1

stinepike
stinepike

Reputation: 54692

You better use AlertDialog. Check this link to know more about android Dialogs

Upvotes: 2

cbrulak
cbrulak

Reputation: 15629

you would do this with an event:

Upvotes: 0

Related Questions