I had a problem creating dialogue. It appears, but its empty inside, only an empty field is shown.
Dialog Class:
public class SomeDialog extends DialogFragment{ @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); LayoutInflater inflater = getActivity().getLayoutInflater(); builder.setView(inflater.inflate(R.layout.somelayout, null)); return super.onCreateDialog(savedInstanceState); } }
In the action creating the object and calling the show method:
SomeDialog obj = new SomeDialog(); obj.show(getFragmentManager(), "randomtag");
user1903985
source share