DialogFragment: uso de AlertDialog con diseño personalizado
Estoy reescribiendo mi aplicación conFragments API
apoyo. En la solicitud original tengo unAlertDialog
que se crea así:
<code> 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(); </code>
¿Cómo puedo mostrar el mismo diálogo a través de un DialogFragment? He leído la documentación, pero tengo problemas para averiguar cómo proceder con esto.