Closed NajeraP95 closed 7 years ago
Is it possible show an AlertDialog with a layout for the Changelog?
I try with: LayoutInflater inflater = LayoutInflater.from(AboutActivity.this); View view = inflater.inflate(R.layout.dialog_whatsnew, null); AlertDialog.Builder builder = new AlertDialog.Builder(AboutActivity.this); builder.setView(view) .setTitle("New") .setCancelable(false) .setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); builder.create().show();
LayoutInflater inflater = LayoutInflater.from(AboutActivity.this);
View view = inflater.inflate(R.layout.dialog_whatsnew, null);
AlertDialog.Builder builder = new AlertDialog.Builder(AboutActivity.this);
builder.setView(view)
.setTitle("New")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.create().show();
But It doesn´t work
@NajeraP95 I'm using material-dialogs (wrapper around AlertDialog) and it's working.
@NajeraP95 The way @Rainer-Lang is doing it would work. That's the beauty of the library - you can use anything.
Is it possible show an AlertDialog with a layout for the Changelog?
I try with:
LayoutInflater inflater = LayoutInflater.from(AboutActivity.this);
View view = inflater.inflate(R.layout.dialog_whatsnew, null);
AlertDialog.Builder builder = new AlertDialog.Builder(AboutActivity.this);
builder.setView(view)
.setTitle("New")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.create().show();
But It doesn´t work