Show spinner in AlertDialog
问题 I want to show a spinner in my alertDialog. I have the following code but it just give me a black screen. Logcat doesn't say any errors. MyActivity.java AlertDialog.Builder builder; AlertDialog alertDialog; Context mContext = getApplicationContext(); LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE); View layout = inflater.inflate(R.layout.spinner,null); String array_spinner[]; array_spinner=new String[5]; array_spinner[0]="US"; array_spinner[1]=