gostaria de pegar os itens do carrinho, e mostrar no alertdiag em android, fiz da seguinte forma,alguém pode dar alguma dica?
public void Vercarrinho(View view){
itensCarrinho= new ArrayList<>();
//final AlertDialog.Builder builder = new AlertDialog.Builder(this);
AlertDialog.Builder alertDalog=new AlertDialog.Builder(this);
alertDalog.setIcon(android.R.drawable.presence_away);
alertDalog.setTitle("Carrinho de Camprar");
alertDalog.setMessage("Confirme Itens do Carrinho");
alertDalog.setCancelable(false);
final FrameLayout frameView = new FrameLayout(this);
alertDalog.setView(frameView);
final AlertDialog alertDialog = alertDalog.create();
LayoutInflater inflater = alertDialog.getLayoutInflater();
alertDalog.setPositiveButton("Confirma", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
alertDalog.setNegativeButton("Camcelar", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(CartapioActivity.this,
"Cancelado",
Toast.LENGTH_LONG).show();
}
});
AlertDialog alert= alertDalog.create();
alert .show();