Custom listview for AlertDialog
问题 I'm trying to have my AlertDialog with a custom list view but can't seem to get it to show or run without error. private void buildDialog(){ int selectedItem = -1; //somehow get your previously selected choice LayoutInflater inflater = ((LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE)); View customView = inflater.inflate(R.layout.listview, null, false); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setView(customView); builder.setTitle("Select