Back to another dialogAlert

Asked

Viewed 39 times

0

I have a process capture system on Android in which when detected something suspicious, it emits an alert window with some options. I would like to know how I do for when I open any of these options, by pressing the back button, that the application would display the previous warning window.

For example, the main alert window

final AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
                builder.setTitle("Sistema Infectado. Aplicação capturada "+ameaca);
                 builder.setIcon(R.drawable.alert);
                showNotificationWarning(); // NOTIFICAÇÃO DE ALERTA
                builder.setItems(new CharSequence[]
                                {"Desinstalar aplicação", "Ignorar", "Detalhes", "Continuar Monitoramento",},
                        new DialogInterface.OnClickListener() {
                            @TargetApi(Build.VERSION_CODES.LOLLIPOP)
                            public void onClick(DialogInterface dialog, int which) {

                                switch (which) {
                                final AlertDialog.Builder detalhes = new AlertDialog.Builder(MainActivity.this);

                                        detalhes.setTitle("Detalhes");// outra janela de aviso. Gostaria que quando eu estivesse nessa janela, ao apertar o back button, voltasse para a primeira janela de aviso
                                        detalhes.setIcon(R.drawable.settings);
  • Instead of a Alertdialog use a Activity

1 answer

0

Creates a call from the first Alertdialog within the method onBackPressed()

Browser other questions tagged

You are not signed in. Login or sign up in order to post.