Because I want to use the FragmentManager
in a dialog, I use onCreateView
instead of onCreateDialog
.
If using this approach, I'm able to set the title of the dialog, but I can't find out how to set dialog buttons. Normally I would do this in createDialog
with an AlertDialog...
Question: Is it possible to use the onCreateView
approach and use dialog buttons? Or can only do this, if I add the buttons manually to my view resource?
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View v = inflater.inflate(R.layout.dialog_exercise_info, null);
// I could include the dialog buttons in the view
// but can I somehow add buttons to the dialog directly?
return v;
}
@Override
protected Dialog createDialog(final Bundle savedInstanceState, Activity activity)
{
Dialog dialog = new Dialog(getActivity(), getTheme());
dialog.setTitle(R.string.title_create_exercise);
return dialog;
}