DialogFragment show - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for DialogFragment show method.

This code example shows how to use the following methods:show, beginTransaction, findFragmentByTag
        return b.create();
    } 
 
    public static void show(FragmentActivity activity, int titleResId, int descriptionResId) {
        FragmentManager fragmentManager = activity.getSupportFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
 
        Fragment prev = fragmentManager.findFragmentByTag(FRAGMENT_TAG);
        if (prev != null) {
            fragmentTransaction.remove(prev);
        } 
        fragmentTransaction.addToBackStack(null);
 
        SampleDescriptionDialogFragment.newInstance(titleResId, descriptionResId)
                .show(fragmentManager, FRAGMENT_TAG);
    } 
 
    public static void dismiss(FragmentActivity activity) {
        FragmentManager fragmentManager = activity.getSupportFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:show, beginTransaction, findFragmentByTag
            return this;
        } 
 
        public void show() { 
            FragmentManager fragmentManager = mActivity.getSupportFragmentManager();
            FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
 
            Fragment prev = fragmentManager.findFragmentByTag(FRAGMENT_TAG);
            if (prev != null) {
                fragmentTransaction.remove(prev);
            } 
            fragmentTransaction.addToBackStack(null);
 
            ProgressDialogFragment.newInstance(mMessage, mOnCancelListener, mCancelable)
                    .show(fragmentManager, FRAGMENT_TAG);
        } 
    } 
 
    public static void dismiss(FragmentActivity activity) {
        FragmentManager fragmentManager = activity.getSupportFragmentManager();
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:show, beginTransaction, findFragmentByTag
            return this;
        } 
 
        public void show() { 
            FragmentManager fragmentManager = mActivity.getSupportFragmentManager();
            FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
 
            Fragment prev = fragmentManager.findFragmentByTag(FRAGMENT_TAG);
            if (prev != null) {
                fragmentTransaction.remove(prev);
            } 
            fragmentTransaction.addToBackStack(null);
 
            ErrorDialogFragment.newInstance(mTitle, mMessage, mOnClickListener, mOnCancelListener)
                    .show(fragmentManager, FRAGMENT_TAG);
        } 
    } 
 
    public static void dismiss(FragmentActivity activity) {
        FragmentManager fragmentManager = activity.getSupportFragmentManager();
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:show, beginTransaction, findFragmentByTag
This code example shows how to use the following methods:getDialog, setCancelable, show
        assertTrue(shadowOf(dialog).isCancelable());
    } 
 
    @Test 
    public void shouldSetNotCancelableOnDialogBeforeShow() throws Exception { 
        DialogFragment dialogFragment = new DialogFragment();
        dialogFragment.setCancelable(false);
        dialogFragment.show(fragmentManager, "TAG");
 
        Dialog dialog = dialogFragment.getDialog();
 
        assertFalse(shadowOf(dialog).isCancelable());
    } 
 
    @Test 
    public void shouldSetNotCancelableOnDialogAfterShow() throws Exception { 
        DialogFragment dialogFragment = new DialogFragment();
        dialogFragment.show(fragmentManager, "TAG");
        dialogFragment.setCancelable(false);
 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:show
	} 
	 
	public static void showLoadingProgress(FragmentManager fragman) {
		dismissLoadingProgress(fragman);
		ProgressDialogFragment loading = new ProgressDialogFragment("Loading...");
		loading.show(fragman, "loading");
	} 
	 
	public static void dismissLoadingProgress(FragmentManager fragman) {
		FragmentTransaction tr = fragman.beginTransaction();
		Fragment frag = fragman.findFragmentByTag("loading");
		if(frag != null){
			tr.remove(frag);
		} 
		tr.commit();
	} 
 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:show
    } 
 
    private void createDialog() { 
        if (mDialog == null) {
            mDialog = AlertDialogFragment.newInstance(mApp);
            mDialog.show(getFragmentManager(), "dialog");
        } 
    } 
 
    private void dismissDialog() { 
        if (mDialog != null) {
            mDialog.dismiss();
            mDialog = null;
        } 
    } 
 
    private void doPositiveClick() { 
        Settings.Global.putInt(getContentResolver(),
                Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE, 1); 
        setResult(RESULT_OK);
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setCancelable, show
	} 
 
	@Override 
	protected void onPreExecute() { 
		final DialogFragment fragment = new ProgressDialogFragment();
		fragment.setCancelable(false);
		fragment.show(activity.getFragmentManager(), PROGRESS_FRAGMENT_TAG);
		super.onPreExecute(); 
	} 
 
	public static File saveImage(final Context context, final File image_file) {
		if (context == null && image_file == null) return null;
		try { 
			final String name = image_file.getName();
			if (isEmpty(name)) return null;
			final String mime_type = getImageMimeType(image_file);
			final MimeTypeMap map = MimeTypeMap.getSingleton();
			final String extension = map.getExtensionFromMimeType(mime_type);
			if (extension == null) return null;
			final String name_to_save = name.indexOf(".") != -1 ? name : name + "." + extension;
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:show
 
//BEGIN_INCLUDE(show_dialog) 
    void showDialog() { 
        // Create the fragment and show it as a dialog. 
        DialogFragment newFragment = MyDialogFragment.newInstance();
        newFragment.show(getFragmentManager(), "dialog");
    } 
//END_INCLUDE(show_dialog) 
 
//BEGIN_INCLUDE(dialog) 
    public static class MyDialogFragment extends DialogFragment {
        static MyDialogFragment newInstance() { 
            return new MyDialogFragment(); 
        } 
 
        @Override 
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                Bundle savedInstanceState) {
            View v = inflater.inflate(R.layout.hello_world, container, false);
            View tv = v.findViewById(R.id.text);
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:show, beginTransaction, findFragmentByTag

Related DialogFragment show Questions & Answers:

Other DialogFragment show Examples

1:	public void showDatePickerDialog(View v) {
2:	    DialogFragment newFragment = new DatePickerFragment();
3:	    newFragment.show(getSupportFragmentManager(), "datePicker");
4:	}
5:

Read More

1:	public void showTimePickerDialog(View v) {
2:	    DialogFragment newFragment = new TimePickerFragment();
3:	    newFragment.show(getSupportFragmentManager(), "timePicker");
4:	}
5:

Read More

show Method Overview
Display the dialog, adding the fragment using an existing transaction and then committing the transaction.
See Code Examples for other Android DialogFragment Methods: