I have good working code when I asked the user to delete item ot not.
case R.id.item_Delete:
Log.d("TAG","Deletion ...");
AlertDialog.Builder delAllDialog = new AlertDialog.Builder(this);
delAllDialog.setTitle("Confirm deletion");
TextView dialogTxt_id = new TextView(this);
LayoutParams dialogTxt_idLayoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);
dialogTxt_id.setLayoutParams(dialogTxt_idLayoutParams);
dialogTxt_id.setText("Delete?");
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
layout.addView(dialogTxt_id);
delAllDialog.setView(layout);
delAllDialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
delete();
}
});
break;
...
It works great!
I just copy this peace of code and place it to another similar activity in right the same menu code.
And I have got Deletion..
in my log and then nothing happened. LogCat it clear, no errors.
I search and find several other same questions (for example Android - AlertDialog doesn't show when called from Main-Method ) but nor cleaning the project nor other things doesn't solve my problem.. Any ideas?