Dialog in open page / taxt / Email / Button / App
final AlertDialog dialog = new AlertDialog.Builder(MainActivity.this).create();
LayoutInflater inflater = getLayoutInflater();
View convertView = (View) inflater.inflate(R.layout.dialog1, null);
dialog.setView(convertView);
TextView txt1 = (TextView)
convertView.findViewById(R.id.textview1);//on custome_dialog
txt1.setText("your text here");
Button
Button btn1 = (Button) convertView.findViewById(R.id.button1);//on custome_dialog
Button showMessage
btn1.setOnClickListener(new View.OnClickListener(){ public void onClick(View v){
dialog.dismiss(); showMessage("your message");
Open Page
Intent intent = new Intent(MainActivity.this, Page_nameActivity.class);
startActivity(intent);
Open Email
Intent send_mail = new Intent(Intent.ACTION_VIEW, Uri.parse("example@gmail.com"));
startActivity(send_mail);
Open App
Intent launch = getPackageManager().getLaunchIntentForPackage("com.my.project");
if (launch != null) {
startActivity(launchIntent);
}
final AlertDialog dialog = new AlertDialog.Builder(MainActivity.this).create();
LayoutInflater inflater = getLayoutInflater();
View convertView = (View) inflater.inflate(R.layout.dialog1, null);
dialog.setView(convertview);
}
});
dialog.show();
Video Halp