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.popdeem.sdk.core.PopdeemSDK.java

/**
* Push the Social Multi-Login Flow Fragment to the supplied Activity
*
* @param activity FragmentActivity / AppCompatActivity to show social login flow in
* @param rewards Rewards to add to social login screen
*///from   w ww  .  j a  va 2s .co m
public static void pushSocialMultiLoginFragmentToActivity(final FragmentActivity activity,
        ArrayList<PDReward> rewards) {
    FragmentManager fragmentManager = activity.getSupportFragmentManager();

    if (rewards != null && rewards.size() > 0) {
        fragmentManager.beginTransaction()
                .add(android.R.id.content, PDUISocialMultiLoginFragment.newInstance(rewards),
                        "PDUISocialMultiLoginFragment")
                //                .addToBackStack(PDUISocialMultiLoginFragment.class.getSimpleName())
                .addToBackStack("PDUISocialMultiLoginFragment").commit();
    } else {
        fragmentManager.beginTransaction()
                .add(android.R.id.content, PDUISocialMultiLoginFragment.newInstance(),
                        "PDUISocialMultiLoginFragment")
                //                .addToBackStack(PDUISocialMultiLoginFragment.class.getSimpleName())
                .addToBackStack("PDUISocialMultiLoginFragment").commit();
    }
}

From source file:ca.rmen.android.scrumchatter.dialog.DialogFragmentFactory.java

/**
 * @param inputValidatorClass will be called with each text event on the edit text, to validate the user's input.
 *///from w  ww .  j a va2  s. c o  m
public static void showInputDialog(FragmentActivity activity, String title, String inputHint,
        String prefilledText, Class<?> inputValidatorClass, int actionId, Bundle extras) {
    Log.v(TAG, "showInputDialog: title = " + title + ", prefilledText =  " + prefilledText + ", actionId = "
            + actionId + ", extras = " + extras);
    Bundle arguments = new Bundle(6);
    arguments.putString(EXTRA_TITLE, title);
    arguments.putString(EXTRA_INPUT_HINT, inputHint);
    arguments.putInt(EXTRA_ACTION_ID, actionId);
    arguments.putString(EXTRA_ENTERED_TEXT, prefilledText);
    if (inputValidatorClass != null)
        arguments.putSerializable(EXTRA_INPUT_VALIDATOR_CLASS, inputValidatorClass);
    arguments.putBundle(EXTRA_EXTRAS, extras);
    InputDialogFragment result = new InputDialogFragment();
    result.setArguments(arguments);
    result.show(activity.getSupportFragmentManager(), InputDialogFragment.class.getSimpleName());
}

From source file:eu.power_switch.gui.StatusMessageHandler.java

/**
 * Shows "No active Gateway" Message//from ww  w .j  a  v a 2 s . c  o m
 *
 * @param fragmentActivity
 */
public static void showNoActiveGatewayMessage(final FragmentActivity fragmentActivity) {
    showInfoMessage(fragmentActivity, R.string.no_active_gateway, R.string.open_settings, new Runnable() {
        @Override
        public void run() {
            MainActivity.addToBackstack(MainActivity.IDENTIFIER_SETTINGS, SettingsTabFragment.class,
                    fragmentActivity.getString(R.string.menu_settings));
            SettingsTabFragment settingsTabFragment = SettingsTabFragment
                    .newInstance(SettingsConstants.GATEWAYS_TAB_INDEX);
            fragmentActivity.getSupportFragmentManager().beginTransaction()
                    .setCustomAnimations(R.anim.slide_in_right, R.anim.slide_out_left,
                            android.R.anim.slide_in_left, android.R.anim.slide_out_right)
                    .replace(R.id.mainContentFrameLayout, settingsTabFragment).addToBackStack(null).commit();
        }
    }, Snackbar.LENGTH_LONG);
}

From source file:com.tomeokin.lspush.ui.widget.dialog.SimpleDialogBuilder.java

public SimpleDialogBuilder(FragmentActivity activity) {
    super(activity, activity.getSupportFragmentManager(), BaseDialogFragment.class);
}

From source file:com.schedjoules.eventdiscovery.framework.utils.fragment.Add.java

@Override
public void commit(FragmentActivity activity) {
    doCommit(activity.getSupportFragmentManager());
}

From source file:com.espian.ticktock.TitleCursorPagerAdapter.java

public TitleCursorPagerAdapter(FragmentActivity act) {
    super(act.getSupportFragmentManager(), CountdownFragment.class, EmptyFragment.class, null, null);
    noItemString = act.getString(R.string.no_items);
    mTitles = new SparseArray<String>();
}

From source file:com.handlerexploit.example.PagerAdapter.java

public PagerAdapter(FragmentActivity fragmentActivity) {
    super(fragmentActivity.getSupportFragmentManager());
    mContext = fragmentActivity.getBaseContext();
}

From source file:me.slezica.android.tools.ui.ExecutorFragment.java

public ExecutorFragment(FragmentActivity parent) {
    parent.getSupportFragmentManager().beginTransaction().add(getId(), this).commit();
}

From source file:com.molidt.easyandroid.bluetooth.BluetoothFragmentV4.java

/**
 * You should call this method to add bluetooth feature.This method will auto begin transcation to add fragment,
 * so you don't need to call SupportFragmentManager and add fragment.
 * @param activity//from w w  w.  j  a v a 2 s  .c o  m
 * @return
 */
public static BluetoothFragmentV4 addBluetoothPlugin(FragmentActivity activity) {
    BluetoothFragmentV4 fragment = new BluetoothFragmentV4();
    fragment.initPlugin(activity);
    activity.getSupportFragmentManager().beginTransaction().add(fragment, BLUETOOTH_FRAGMENT_TAG).commit();
    return fragment;
}

From source file:eu.thedarken.rootvalidator.ui.ShareDialog.java

public void showDialog(FragmentActivity activity) {
    show(activity.getSupportFragmentManager(), ShareDialog.class.getName());
}