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 isS开发者_JAVA技巧howing() 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.Builder
class. There is one on the Dialog
class though.
AlertDialog.Builder
Dialog
An AlertDialog.Builder
is used to create an AlertDialog
. Once you have an instance of an AlertDialog
, you can determine whether or not it is still showing by then calling isShowing() on it.
精彩评论