remove_comment.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder alert = new AlertDialog.Builder(MainActivity.currentActivity);
alert.setTitle("are you sure?");
alert.setCancelable(true);
alert.setPositiveButton("yeah", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
RequestParams params = new RequestParams();
params.put("comment_id", item.getComment_id());
Internet.post("event/remove_comment", params, "removed");
base.setVisibility(View.GONE);
myevent.get(position).commenter.remove(holder.mpoid);
notifyDataSetChanged();
}
});
alert.setNegativeButton("no", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
alert.show();
}
});
This is my code for removing one comment with alert, but The alert does not show. Just when I click on back button show all alert. Any ideas?
It is currentActivity on MainActivity that was created onResume
@Override
public void onResume(){
currentActivity=this;
super.onResume();
}