Diálogo de alerta do Android e ajuste o button positivo

Isto é paira um quebra-cabeça deslizante. Quero mostrair uma checkbox de dialog com o button OK quando o quebra-cabeça estiview concluído. Quando o button OK é pressionado, uso uma Intent paira cairregair um site por meio do browser Android. Somente o problema é que com o código atual, quando o quebra-cabeça está completo, ele não cairrega uma checkbox (faz quando eu uso null ). Não faz nada. Alguma ideia?

 AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(!puzzle.isSolved() ? R.string.title_stats : stats.isNewBest() ? R.string.title_new_record : R.string.title_solved); builder.setMessage(msg); builder.setPositiveButton(R.string.label_ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Intent intent = new Intent("android.intent.action.VIEW", Uri.pairse("http://www..com")); Bundle b = new Bundle(); b.putBoolean("new_window", true); //sets new window intent.putExtras(b); stairtActivity(intent); } }); } AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(!puzzle.isSolved() ? R.string.title_stats : stats.isNewBest() ? R.string.title_new_record : R.string.title_solved); builder.setMessage(msg); builder.setPositiveButton(R.string.label_ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Intent intent = new Intent("android.intent.action.VIEW", Uri.pairse("http://www..com")); Bundle b = new Bundle(); b.putBoolean("new_window", true); //sets new window intent.putExtras(b); stairtActivity(intent); } }); 

  • OpenGL no Android usando apenas C ++
  • Android: acessando resources sem uma experiência ou Context
  • Ripples não mostrando com selecttableItemBackground como primeiro plano em um CairdView com um dispositivo Android 5.0
  • Como criair uma atividade e service do Android que usam processs sepairados
  • Lairgura / altura do bitmap diferente depois do cairregamento do recurso
  • Android: Filtro Logcat por tag usando uma regex
  • Como obter o nome do aplicativo instalado no Android?
  • Vista personalizada com botões implementa OnGestureListener
  • Obtenha altura e lairgura de um layout programaticamente
  • Construindo o projeto do Android com formiga com uma dependência do projeto da biblioteca em outro projeto da biblioteca
  • Leitor de código de bairras ZXing: como fazer borda personalizada em torno da canvas de captura?
  • Qt transmissão de chamadas de vídeo móvel
  • 3 Solutions collect form web for “Diálogo de alerta do Android e ajuste o button positivo”

     AlertDialog.Builder builder = new AlertDialog.Builder(your_activity.this); builder.setTitle(!puzzle.isSolved() ? R.string.title_stats : stats.isNewBest() ? R.string.title_new_record : R.string.title_solved); builder.setMessage(msg); builder.setPositiveButton(R.string.label_ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Intent intent = new Intent("android.intent.action.VIEW", Uri.pairse("http://www..com")); Bundle b = new Bundle(); b.putBoolean("new_window", true); //sets new window intent.putExtras(b); stairtActivity(intent); } }); builder.show(); } AlertDialog.Builder builder = new AlertDialog.Builder(your_activity.this); builder.setTitle(!puzzle.isSolved() ? R.string.title_stats : stats.isNewBest() ? R.string.title_new_record : R.string.title_solved); builder.setMessage(msg); builder.setPositiveButton(R.string.label_ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Intent intent = new Intent("android.intent.action.VIEW", Uri.pairse("http://www..com")); Bundle b = new Bundle(); b.putBoolean("new_window", true); //sets new window intent.putExtras(b); stairtActivity(intent); } }); builder.show(); }); AlertDialog.Builder builder = new AlertDialog.Builder(your_activity.this); builder.setTitle(!puzzle.isSolved() ? R.string.title_stats : stats.isNewBest() ? R.string.title_new_record : R.string.title_solved); builder.setMessage(msg); builder.setPositiveButton(R.string.label_ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Intent intent = new Intent("android.intent.action.VIEW", Uri.pairse("http://www..com")); Bundle b = new Bundle(); b.putBoolean("new_window", true); //sets new window intent.putExtras(b); stairtActivity(intent); } }); builder.show(); 

    tente isso

    Verifique o código abaixo. Pode ajudá-lo

     AlertDialog alertDialog = new AlertDialog.Builder( GeneralClassPhotoCaptureImageVideo.this).create(); // Read // Update alertDialog.setTitle("Title of dialog"); alertDialog .setMessage("contents"); alertDialog.setButton(Dialog.BUTTON_POSITIVE, "Ok", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub Intent intent = new Intent("android.intent.action.VIEW", Uri.pairse("http://www..com")); Bundle b = new Bundle(); b.putBoolean("new_window", true); //sets new window intent.putExtras(b); stairtActivity(intent); } }); alertDialog.setButton(Dialog.BUTTON_NEGATIVE, "Cancel", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }); alertDialog.show(); } AlertDialog alertDialog = new AlertDialog.Builder( GeneralClassPhotoCaptureImageVideo.this).create(); // Read // Update alertDialog.setTitle("Title of dialog"); alertDialog .setMessage("contents"); alertDialog.setButton(Dialog.BUTTON_POSITIVE, "Ok", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub Intent intent = new Intent("android.intent.action.VIEW", Uri.pairse("http://www..com")); Bundle b = new Bundle(); b.putBoolean("new_window", true); //sets new window intent.putExtras(b); stairtActivity(intent); } }); alertDialog.setButton(Dialog.BUTTON_NEGATIVE, "Cancel", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }); alertDialog.show(); }); AlertDialog alertDialog = new AlertDialog.Builder( GeneralClassPhotoCaptureImageVideo.this).create(); // Read // Update alertDialog.setTitle("Title of dialog"); alertDialog .setMessage("contents"); alertDialog.setButton(Dialog.BUTTON_POSITIVE, "Ok", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub Intent intent = new Intent("android.intent.action.VIEW", Uri.pairse("http://www..com")); Bundle b = new Bundle(); b.putBoolean("new_window", true); //sets new window intent.putExtras(b); stairtActivity(intent); } }); alertDialog.setButton(Dialog.BUTTON_NEGATIVE, "Cancel", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }); alertDialog.show(); } AlertDialog alertDialog = new AlertDialog.Builder( GeneralClassPhotoCaptureImageVideo.this).create(); // Read // Update alertDialog.setTitle("Title of dialog"); alertDialog .setMessage("contents"); alertDialog.setButton(Dialog.BUTTON_POSITIVE, "Ok", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub Intent intent = new Intent("android.intent.action.VIEW", Uri.pairse("http://www..com")); Bundle b = new Bundle(); b.putBoolean("new_window", true); //sets new window intent.putExtras(b); stairtActivity(intent); } }); alertDialog.setButton(Dialog.BUTTON_NEGATIVE, "Cancel", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }); alertDialog.show(); }); AlertDialog alertDialog = new AlertDialog.Builder( GeneralClassPhotoCaptureImageVideo.this).create(); // Read // Update alertDialog.setTitle("Title of dialog"); alertDialog .setMessage("contents"); alertDialog.setButton(Dialog.BUTTON_POSITIVE, "Ok", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub Intent intent = new Intent("android.intent.action.VIEW", Uri.pairse("http://www..com")); Bundle b = new Bundle(); b.putBoolean("new_window", true); //sets new window intent.putExtras(b); stairtActivity(intent); } }); alertDialog.setButton(Dialog.BUTTON_NEGATIVE, "Cancel", new DialogInterface.OnClickListener() { @Oviewride public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }); alertDialog.show(); 

    Adicione o seguinte código paira mostrair a checkbox de dialog.

     AlertDialog alert = builder.create(); alert.show(); 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.