0
I have the following problem, I have a method that is called, when one clicks on a button, AND HOLD, (onLongClickListener) will appear an Alert with several options. 1st Option is Cancel the Table, 2nd View orders, and 3rd Call another Action. It happens, that gives error when I click on the third option, where would be my Intent, calling another Activity.
Obs: Initialization of the other Activity has no error, because I can access it by other buttons using the same method Intent Intent = new Intent();
private AlertDialog opcoes;
CharSequence op[] = new CharSequence[] {"Cancelar Mesa", "Ver Pedidos", "Acrescentar/Alterar Pedido", "Teste"};
private void opcoesMesas(final View v) {
//Cria o gerador do AlertDialog
AlertDialog.Builder builder = new AlertDialog.Builder(this);
// define o titulo
builder.setTitle("Escolha a Opção desejada: ");
//define a mensagem
//builder.setMessage("Deseja cancelar essa mesa?");
//define um botão como positivo
builder.setItems(op, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
switch(i){
case 0:
ConfirmacaoDeCancelamento(v);
break;
case 1:
exibindoPedidosDasMesas(v);
break;
case 2:
openPedidos();
break;
case 3:
break;
default:
}
}
});
builder.show();
}
private void openPedidos(){
startActivity(new Intent(getBaseContext(),pedidos.class));
}
In case 2:, I already tried to put the Intent straight, also can not. And he recognizes that he was clicked on the third option, because I already put a Toat to inform me in case 2, and it worked.
Help me, I just need to call another screen, by clicking on Case 2.
Pole the logcat with the error.
– ramaral