So a dialog is opened every time a text is received. I want it to not open one if there is one already open. I was trying to check if one was open by using isShowing() but I keep getting the method isShowing() is undefinded for the type AlertDialog.Builder. Here is the section of bad code. Any help would be so sweet right about now.
public class PopUpReply extends Activity{
AlertDialog.Builder alertbox;
AlertDialog.Builder alert;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// prepare the alert box
alertbox.isShowing();
alertbox = new AlertDialog.Builder(this);
There is no isShowing() method on the
AlertDialog.Builderclass. There is one on theDialogclass though.AlertDialog.Builder
Dialog
An
AlertDialog.Builderis used to create anAlertDialog. Once you have an instance of anAlertDialog, you can determine whether or not it is still showing by then calling isShowing() on it.