У меня есть ReceiveListFragment
класс. Thats расширяет ListFragment
и я хочу использовать DialogFragment
но я получаю эту ошибку:Использование Android DialogFragment в расширении ListFragment класс
Error:(200, 15) java: no suitable method found for show(android.support.v4.app.FragmentManager,java.lang.String)
method android.app.DialogFragment.show(android.app.FragmentTransaction,java.lang.String) is not applicable
(actual argument android.support.v4.app.FragmentManager cannot be converted to android.app.FragmentTransaction by method invocation conversion)
method android.app.DialogFragment.show(android.app.FragmentManager,java.lang.String) is not applicable
(actual argument android.support.v4.app.FragmentManager cannot be converted to android.app.FragmentManager by method invocation conversion)
я использовать и определить, как с этим кодом:
FragmentManager manager = getFragmentManager();
AddNoteDialogFragment dialog = new AddNoteDialogFragment();
dialog.show(manager,"1");
Мой DialogFragment
класс:
public class AddNoteDialogFragment extends DialogFragment {
public AddNoteDialogFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
getDialog().setTitle(getString(R.string.app_name));
View view = inflater.inflate(R.layout.view_sms_dialog,
container);
return view;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Dialog dialog = super.onCreateDialog(savedInstanceState);
dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
return dialog;
}
}
Посмотрите: http://developer.android.com/guide/topics/ui/dialogs.html –