参考:博客,解决了我的问题,在这里记录一下。
private void showDialogCustom(){
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("选择:");
builder.setItems(mCustomItems, new DialogInterface.OnClickListener() {
...
上述代码中引入的AlertDialog包名错误,应该引入import android.app.AlertDialog;
因篇幅问题不能全部显示,请点此查看更多更全内容