How can I make the button in BaseAdapter in listView shows alertDialog, I tried that but it Stopped work unexpected (RunTime Error) my code is shown below .
any suggesti
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(view.getRootView().getContext());
alertDialogBuilder.setMessage("Are you sure you want to delete?");
alertDialogBuilder.setPositiveButton("Ok",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
deleteExp(tid);
}
});
alertDialogBuilder.setNegativeButton("cancel",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
}
});
AlertDialog alertDialog = alertDialogBuilder.create();
alertDialog.show();