如何实现警报对话框?

死亡笔记

我有一个按钮,如果单击该按钮,将打开一个包含呼叫日志列表的警报对话框。但是这样做只会显示对话框标题。这是我的代码:

 protected void showCustomDialog() {
            // TODO Auto-generated method stub

            // this method returns the cursor with all call logs.. i've checked the cursor                                 and it is returning.
            Cursor curLog = CallLogHelper.getAllCallLogs(getContentResolver());

            // it fills the conNames arraylist with its values.
            setCallLogs(curLog);

            ListView listitems=new ListView(this);
            MyAdapter adapter = new MyAdapter( this , R.layout.dialog_list,conNames);

            //dialog_list is layout of each item of the list.

            alertDialogStores = new AlertDialog.Builder(MainActivity.this)
            .setView(listitems)
            .setTitle("Stores")
            .show();
}
瓦苏杰夫

listitems.setAdapter(adapter);

ListView listitems=new ListView(this);
MyAdapter adapter = new MyAdapter( this , R.layout.dialog_list,conNames);

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章