There is a way , but the information is very old (we should do without deprecated methods).

  • If without deprecated , then do the same thing as in the guide on the link, but with the help of DialogFragment - pavlofff

1 answer 1

 import android.app.AlertDialog.Builder; ... alertdialog(); ... public void alertdialog() { final CharSequence[] items = {"ΠΎΠ΄ΠΈΠ½","Π΄Π²Π°","Ρ‚Ρ€ΠΈ"};//ΠΈΠΌΠ΅Π½Π° ΠΌΠ΅Ρ‚ΠΎΠ΄ΠΎΠ² Π’Π°ΡˆΠΈΡ… Π² спискС Builder builder = new AlertDialog.Builder(MainActivity.this, R.style.AlertDialogCustom); builder.setItems(items, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { if (item == 0) { //"ΠΎΠ΄ΠΈΠ½" //method } if (item == 1) { //"Π΄Π²Π°" //method } if (item == 2) { //"Ρ‚Ρ€ΠΈ" //method } }); AlertDialog alert = builder.create(); alert.show(); } 
  • Everything works, but there are minor syntax errors in the code. (I had to think a head) - Vladimir Saleev
  • @ VladimirSaleev would have written) would help :) - iFr0z
  • I figured it out. At the same time at least a little thought, and not just copied and pasted. - Vladimir Saleev