What's new
DroidForums.net | Android Forum & News

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Alert Dialog trouble

kraxyk

Member
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();
 
Back
Top