AlertDialog和软键盘

Lib*_*hos 5 java android

嗨,大家好我正在开发一个Android应用程序.我正在使用alertDialog类.我有自定义列表视图和2个按钮.在我的自定义列表视图中,我有一个EditText字段.但是当对话框弹出时我触摸EditText而光标在文本框中开始闪烁,软键盘没有出现.是不是因为alertdialog?感谢您的时间.

public class ProgressReport extends ListActivity {

private ResultSet receivedData;
private StudentProgressAdapter ca;
private Button btnRtn;
ArrayList<String> content =new ArrayList<String>();
ArrayList<String> subContent = new ArrayList<String>();
AlertDialog dialog ;


 @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);     
        setTheme(android.R.style.Theme_Holo_Light);         
        setContentView(R.layout.examslayout);



        for(int i =0;i<20;i++)
          content.add("ELEMENTARY: "+i);

          for(int i =0;i<20;i++)
              subContent.add("?????? ?????????");


            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.setTitle("Student Stats").setPositiveButton("Yes",new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog,int id) {
                    // if this button is clicked, close
                    // current activity
                    //MainActivity.this.finish();
                }
              })
            .setNegativeButton("No",new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog,int id) {
                    // if this button is clicked, just close
                    // the dialog box and do nothing
                    dialog.cancel();
                }
            });;

            ListView modeList = new ListView(this);

            modeList.setAdapter(new ProgressReportAdapter2(this, new int[]{R.layout.arrowlistview}, new int[]{R.id.textView1,R.id.textView2},content,20,subContent));

            builder.setView(modeList);

            dialog = builder.create();
            dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE|WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);

        Intent intent = getIntent();      
        receivedData =  (ResultSet) intent.getSerializableExtra("SentData");

        ArrayList<String> content = new ArrayList<String>(MainPagerActivity.receivedData.getStudents().length);
        for (int i=0; i <receivedData.getStudents().length; i++)
              content.add(receivedData.getStudents()[i].getProperty(3).toString()+" "+receivedData.getStudents()[i].getProperty(2).toString());

        ca= new StudentProgressAdapter(this, new int[]{R.layout.stdprgrlistview}, new int[]{R.id.textView1}, content,content.size());
        setListAdapter(ca); 

        btnRtn= (Button) findViewById(R.id.btn);
        btnRtn.setOnClickListener(new OnClickListener() {            
            public void onClick(View v) {     

                finish();

            }
        });


    }

    @Override
    public void onListItemClick(ListView l, View v, int position, long id) {    


        dialog.show();



    }
Run Code Online (Sandbox Code Playgroud)