StackOverflowError when trying to inflate a custom layout for an AlertDialog inside a DialogFragment

view story

http://stackoverflow.com – I'm trying to create an AlertDialog, by using the Builder and setting a custom view. When I try to inflate the view inside of onCreateDialog, I get a StackOverflowError.. Here is the code up to the point where it loops back to onCreateDialog: @Override public Dialog onCreateDialog(Bundle savedInstanceState){ AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.enter_time); LinearLayout outerLayout = (LinearLayout) getLayoutInflater(savedInstanceState) .inflate(R.layout.time_entry_dialog, null); ... } And here is the Lo (HowTos)