There is a way , but the information is very old (we should do without deprecated methods).
1 answer
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
|
DialogFragment- pavlofff