Something I got confused, the dialog box opens when the first launch occurs, and when you call it again, it crashes:
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first. I understand what this error is, but I also give the basic context
public void createAlertInfo() { imquastion.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { AlertDialog.Builder builder = new AlertDialog.Builder(PreviewActivity.this); builder.setTitle(R.string.app_name).setMessage(R.string.quastion) .setIcon(R.drawable.icon_512).setCancelable(false).setView(mImagealert) .setNegativeButton(R.string.alertcancelbt, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); builder.show(); } }); } when restarting the dialog, the window falls on this line:
builder.show(); Inherited from extends Activity