Advertisement
Tantr

Exact

Nov 16th, 2011
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1. AlertDialog.Builder builder;
  2.                     AlertDialog alertDialog;
  3.                    
  4.                     Context mContext = getApplicationContext();
  5.                     LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
  6.                     View layout = inflater.inflate(R.layout.custom_dialog,
  7.                                                    (ViewGroup) findViewById(R.id.layout_root));
  8.  
  9.                     TextView text = (TextView) layout.findViewById(R.id.text);
  10.                     text.setText("Hello, this is a custom dialog!");
  11.                     ImageView image = (ImageView) layout.findViewById(R.id.image);
  12.                     image.setImageResource(R.drawable.image);
  13.  
  14.                     builder = new AlertDialog.Builder(mContext);
  15.                     builder.setView(layout);
  16.                     alertDialog = builder.create();
  17.                    
  18.                     alertDialog.show();
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement