我在Fragments API
支持下重写我的应用程序。在原始应用程序中,我有一个AlertDialog
这样创建的:
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.button_dialog, null);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(view);
ListView mListView = (ListView) view.findViewById(R.id.mblist);
builder.setTitle(getString(R.string.sysinfo)).setNeutralButton(
getString(R.string.okay), null);
Cursor dcursor = propManager.propCursor();
if (dcursor.moveToFirst()) {
startManagingCursor(dcursor);
String[] from = { Constants.NAME_DET,
Constants.VALUE_DET };
int[] to = { R.id.mbname, R.id.mbvalue };
SimpleCursorAdapter dadapter = new SimpleCursorAdapter(this,
R.layout.info_list_row, dcursor, from, to);
mListView.setAdapter(dadapter);
}
final Dialog dialog = builder.create();
dialog.show();
如何通过 DialogFragment 显示相同的对话框?我已阅读文档,但无法弄清楚如何进行此操作。