Widget - Dialog Custome

Anmol dwivedi
0

final AlertDialog dialog = new AlertDialog.Builder(MainActivity.this).create();
LayoutInflater inflater = getLayoutInflater();

View convertView = (View) inflater.inflate(R.layout.custom_dialog, null);
dialog.setView(convertView);

TextView txt1 = (TextView)
convertView.findViewById(R.id.textview1);//on custome_dialog
txt1.setText("your text here!");

Button btn1 = (Button) convertView.findViewById(R.id.button1);//on custome_dialog

btn1.setOnClickListener(new View.OnClickListener(){
    public void onClick(View v){
dialog.dismiss();
        showMessage("Aan");
     
    }
});

dialog.show();

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Post a Comment (0)
Our website uses cookies to enhance your experience. Learn More
Accept !