teja2495
9/19/2018 - 7:52 AM

Alert Dialog (Setting and Displaying the List)

//Creating the list for displaying
String[] movienames=new String[movielist.size()];
for(int i=0;i<movielist.size();i++)
    movienames[i] = movielist.get(i).name;

//Display the list
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MainActivity.this);
    dialogBuilder.setTitle("____");
    dialogBuilder.setItems(someStringArray, new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int item) {
            
        }
    });
    
AlertDialog alertDialogObject = dialogBuilder.create();
alertDialogObject.show();