Advertisement
Guest User

custom dialog alert dialog builder

a guest
Aug 28th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. AlertDialog.Builder builder=new AlertDialog.Builder(this);
  2.        
  3.          LayoutInflater inflater = getLayoutInflater();
  4.  
  5.             // Inflate and set the layout for the dialog
  6.             // Pass null as the parent view because its going in the dialog layout
  7.          View view=inflater.inflate(R.layout.custom_dialog, null);
  8.          builder.setView(view);
  9.        
  10.         Dialog dialog = builder.create();
  11.         dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
  12.  
  13.         Button btnPositive=(Button) view.findViewById(R.id.btnPositive);
  14.         Button btnNegative=(Button) view.findViewById(R.id.btnNegative);
  15.         Button btnNeutral=(Button) view.findViewById(R.id.btnNeutral);
  16.        
  17.         TextView txvTitle=(TextView)view.findViewById(R.id.title);
  18.         TextView txvMessage=(TextView)view.findViewById(R.id.message);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement