Example usage for android.support.v4.app FragmentActivity getSupportFragmentManager

List of usage examples for android.support.v4.app FragmentActivity getSupportFragmentManager

Introduction

In this page you can find the example usage for android.support.v4.app FragmentActivity getSupportFragmentManager.

Prototype

public FragmentManager getSupportFragmentManager() 

Source Link

Document

Return the FragmentManager for interacting with fragments associated with this activity.

Usage

From source file:com.androidquery.simplefeed.PQuery.java

public void forward(FragmentActivity act, int requestCode, int resultCode, Intent data) {

    if (data == null)
        return;/*from   ww w.  j a  v  a2s  .  c o  m*/

    String method = data.getStringExtra(FW_CB);

    AQUtility.debug("being forwarded!", method);

    if (method == null)
        return;

    int id = data.getIntExtra(FW_ID, -1);
    if (id != -1) {

        Fragment f = act.getSupportFragmentManager().findFragmentById(id);

        AQUtility.debug("fr", f);

        if (f != null) {
            AQUtility.invokeHandler(f, method, false, true, FW_SIG, requestCode, resultCode, data);
        }

    }
}

From source file:org.rm3l.ddwrt.tiles.admin.nvram.NVRAMDataRecyclerViewAdapter.java

public NVRAMDataRecyclerViewAdapter(FragmentActivity context, Router router, NVRAMInfo nvramInfo) {
    this.context = context;
    this.mGlobalPreferences = context
            .getSharedPreferences(DDWRTCompanionConstants.DEFAULT_SHARED_PREFERENCES_KEY, Context.MODE_PRIVATE);
    this.router = router;
    this.fragmentManager = context.getSupportFragmentManager();
    //noinspection ConstantConditions
    this.setEntryList(nvramInfo.getData());
}

From source file:ro.expectations.expenses.ui.backup.FinancistoImportFragment.java

private void showProgressDialog() {
    FragmentActivity activity = getActivity();
    if (activity != null) {
        ProgressDialogFragment.newInstance(getString(R.string.financisto_import_progress), false)
                .show(activity.getSupportFragmentManager(), "ProgressDialogFragment");
    }/*from  ww  w  . j a v a2s  .co  m*/
}

From source file:ro.expectations.expenses.ui.backup.BackupFragment.java

private void showProgressDialog(String message) {
    FragmentActivity activity = getActivity();
    if (activity != null) {
        ProgressDialogFragment.newInstance(message, false).show(activity.getSupportFragmentManager(),
                "ProgressDialogFragment");
    }//from  ww w  . j a v  a  2  s  . c o m
}

From source file:com.android.volley.cache.plus.SimpleImageLoader.java

/**
 * Creates an ImageLoader with Bitmap memory cache. No default placeholder image will be shown
 * while the image is being fetched and loaded.
 *//*w  ww . ja  va 2s .co  m*/
public SimpleImageLoader(FragmentActivity activity, ImageCacheParams imageCacheParams) {
    super(newRequestQueue(activity, imageCacheParams),
            BitmapImageCache.getInstance(activity.getSupportFragmentManager(), imageCacheParams),
            activity.getResources());
}

From source file:ro.expectations.expenses.ui.backup.BackupFragment.java

private void hideProgressDialog() {
    FragmentActivity activity = getActivity();
    if (activity != null) {
        ProgressDialogFragment progressDialogFragment = (ProgressDialogFragment) activity
                .getSupportFragmentManager().findFragmentByTag("ProgressDialogFragment");
        if (isResumed() && progressDialogFragment != null && progressDialogFragment.getDialog().isShowing()) {
            progressDialogFragment.dismiss();
        } else {//from  w ww . j  a  va2s. c  om
            mDismissProgressBar = true;
        }
    }
}

From source file:com.jefftharris.passwdsafe.sync.owncloud.OwncloudProvider.java

@Override
public void startAccountLink(FragmentActivity activity, int requestCode) {
    AccountChooserDlg dialog = AccountChooserDlg.newInstance(SyncDb.OWNCLOUD_ACCOUNT_TYPE, requestCode,
            activity.getString(R.string.no_owncloud_accts));
    dialog.show(activity.getSupportFragmentManager(), null);
}

From source file:android.support.v17.leanback.app.GuidedStepSupportFragment.java

/**
 * Adds the specified GuidedStepSupportFragment as content of Activity; no backstack entry is added so
 * the activity will be dismissed when BACK key is pressed.  The method is typically called in
 * Activity.onCreate() when savedInstanceState is null.  When savedInstanceState is not null,
 * the Activity is being restored,  do not call addAsRoot() to duplicate the Fragment restored
 * by FragmentManager./*from  w  w  w .j  av  a 2s.  co  m*/
 * {@link #UI_STYLE_ACTIVITY_ROOT} is assigned.
 *
 * Note: currently fragments added using this method must be created programmatically rather
 * than via XML.
 * @param activity The Activity to be used to insert GuidedstepFragment.
 * @param fragment The GuidedStepSupportFragment to be inserted into the fragment stack.
 * @param id The id of container to add GuidedStepSupportFragment, can be android.R.id.content.
 * @return The ID returned by the call FragmentTransaction.commit, or -1 there is already
 *         GuidedStepSupportFragment.
 */
public static int addAsRoot(FragmentActivity activity, GuidedStepSupportFragment fragment, int id) {
    // Workaround b/23764120: call getDecorView() to force requestFeature of ActivityTransition.
    activity.getWindow().getDecorView();
    FragmentManager fragmentManager = activity.getSupportFragmentManager();
    if (fragmentManager.findFragmentByTag(TAG_LEAN_BACK_ACTIONS_FRAGMENT) != null) {
        Log.w(TAG, "Fragment is already exists, likely calling "
                + "addAsRoot() when savedInstanceState is not null in Activity.onCreate().");
        return -1;
    }
    FragmentTransaction ft = fragmentManager.beginTransaction();
    fragment.setUiStyle(UI_STYLE_ACTIVITY_ROOT);
    return ft.replace(id, fragment, TAG_LEAN_BACK_ACTIONS_FRAGMENT).commit();
}

From source file:com.blue.leaves.util.task.SugarTask.java

private void registerHookToContext(@NonNull FragmentActivity activity) {
    android.support.v4.app.FragmentManager manager = activity.getSupportFragmentManager();

    HookSupportFragment hookSupportFragment = (HookSupportFragment) manager.findFragmentByTag(TAG_HOOK);
    if (hookSupportFragment == null) {
        hookSupportFragment = new HookSupportFragment();
        manager.beginTransaction().add(hookSupportFragment, TAG_HOOK).commitAllowingStateLoss();
    }/*from  w w w.j a  v a2s .c om*/
}

From source file:com.blue.leaves.util.task.SugarTask.java

private void unregisterHookToContext(@NonNull FragmentActivity activity) {
    android.support.v4.app.FragmentManager manager = activity.getSupportFragmentManager();

    HookSupportFragment hookSupportFragment = (HookSupportFragment) manager.findFragmentByTag(TAG_HOOK);
    if (hookSupportFragment != null) {
        hookSupportFragment.postEnable = false;
        manager.beginTransaction().remove(hookSupportFragment).commitAllowingStateLoss();
    }/*  w w  w .j a  va  2 s .  c  o m*/
}