1. You want that $100.00 in your pocket or an Amazon Fire TV don't you? Well here's the deal. With our new updated look we are in desperate need of an updated logo. The 'old' one has certainly served us well, but it's time. Find all the details here: bit.ly/1q0k6Wa
  2. DroidForums.net is currently undergoing a major software upgrade. If you are experiencing any problems logging in please: Contact Us

Alert Dialog trouble

Discussion in 'Android App Developers' started by kraxyk, Nov 1, 2010.

  1. kraxyk
    Offline

    kraxyk New Member

    Joined:
    Feb 8, 2010
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    0
    Hello, I am trying to get my alert box working. Can you help me? This code does not seem to work at all.

    Code:
    AlertDialog.Builder safetybuilder = new AlertDialog.Builder(this);
            safetybuilder.setMessage("Do not use this app while the vehicle is in motion. Doing so can seriously injur yourself or someone else. We are not responsible for anything that may happen. Please use this at your own risk.");
            safetybuilder.setCancelable(false);
            safetybuilder.setPositiveButton("Agree", new DialogInterface.OnClickListener() {
                
                public void onClick(DialogInterface dialog, int which) {
                    // TODO Auto-generated method stub
                    dialog.cancel();
                }
            });
            
            safetybuilder.setNegativeButton("Close", new DialogInterface.OnClickListener() {
                
                public void onClick(DialogInterface dialog, int which) {
                    // TODO Auto-generated method stub
                    System.exit(0);
                }
            });
            AlertDialog safety = safetybuilder.create();
            safetybuilder.create();
    
  2. kraxyk
    Offline

    kraxyk New Member

    Joined:
    Feb 8, 2010
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    0
    Is it formatted wrong? Or is it missing something?