الكود الاول لانشاء الديالوج والزر الاول
الكود التاني للزر التاني:
final AlertDialog dialog = new AlertDialog.Builder(MainActivity.this).create();
LayoutInflater inflater = getLayoutInflater();
View convertView = (View) inflater.inflate(R.layout.dialog, null);
dialog.setView(convertView);
TextView txt1 = (TextView)
convertView.findViewById(R.id.textview1);//on custome_dialog
txt1.setText("هل اعجبك الشرح?");
Button btn1 = (Button) convertView.findViewById(R.id.button1);//on custome_dialog
Button btn2 = (Button) convertView.findViewById(R.id.button2);//on custome_dialog
btn1.setOnClickListener(new View.OnClickListener(){
public void onClick(View v){
dialog.dismiss();
showMessage("نعم");
الكود الثالت لإضهار الديالوج
}
});
btn2.setOnClickListener(new View.OnClickListener(){
public void onClick(View v){
dialog.dismiss();
showMessage("لا");
}
});
dialog.show();
تعليقات: 0
إرسال تعليق