Code example for Dialog

Methods: cancel

0
        public CustomListener(Dialog dialog) {
            this.dialog = dialog;
        } 
        @Override 
        public void onClick(View v) {
            dialog.cancel();
            new FlashOperation().execute();
        } 
    } 
 
    private void makedialog(){ 
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setTitle(dtitlu)
                .setMessage(nFile+" "+getString(R.string.flash_info,part)+" "+tip.toUpperCase()+"\n\n"+getString(R.string.wipe_cache_msg))
                .setNegativeButton(getString(R.string.cancel),
                        new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog,int id) {
                                dialog.cancel();
                                //finish(); 
                            } 
                        })