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.github.jksiezni.permissive.fragments.RationaleDialogFragment.java

@Override
public void onShowRationale(Activity activity, String[] allowablePermissions, PermissiveMessenger messenger) {
    this.allowablePermissions = allowablePermissions;
    this.permissiveMessenger = messenger;

    if (activity instanceof FragmentActivity) {
        FragmentActivity fa = (FragmentActivity) activity;
        show(fa.getSupportFragmentManager(), null);
    } else {/* w  ww . ja va  2  s .c  o  m*/
        throw new ClassCastException("This fragment (" + this
                + ") requires an instance of FragmentActivity to work, but was: " + activity);
    }
}

From source file:id.nci.stm_9.KeychainIntentServiceHandler.java

public void showProgressDialog(FragmentActivity activity) {
    mProgressDialogFragment.show(activity.getSupportFragmentManager(), "progressDialog");
}

From source file:se.chalmers.watchme.activity.TabsAdapter.java

public TabsAdapter(FragmentActivity activity, ViewPager pager) {
    super(activity.getSupportFragmentManager());
    this.context = activity;
    this.actionBar = activity.getActionBar();
    this.viewPager = pager;
    this.viewPager.setAdapter(this);
    this.viewPager.setOnPageChangeListener(this);
}

From source file:com.linkedin.android.eventsapp.EventTabsAdapter.java

public EventTabsAdapter(FragmentActivity activity, ViewPager pager) {
    super(activity.getSupportFragmentManager());
    mContext = activity;//from  w  ww . j a  va 2  s .c  o  m
    mActionBar = activity.getActionBar();
    mViewPager = pager;
    mViewPager.setAdapter(this);
    mViewPager.setOnPageChangeListener(this);
}

From source file:com.ushahidi.android.app.helpers.TabManager.java

public TabManager(FragmentActivity activity, ActionBar actionBar, ViewPager pager) {
    super(activity.getSupportFragmentManager());
    mContext = activity;//from   w  w  w .j  a  va2s .c  o  m
    mActionBar = actionBar;
    mViewPager = pager;
    mViewPager.setAdapter(this);
    mViewPager.setOnPageChangeListener(this);
}

From source file:org.coursera.android.shift.ShiftLauncherView.java

private ShiftIconFragment getIconFragment(FragmentActivity activity) {
    FragmentManager manager = activity.getSupportFragmentManager();
    return (ShiftIconFragment) manager.findFragmentByTag(FLOATING_ICON_TAG);
}

From source file:com.handlerexploit.news.adapters.PagerAdapter.java

public PagerAdapter(FragmentActivity activity, ViewPager pager, PagerHeader header) {
    super(activity.getSupportFragmentManager());
    mContext = activity;/*  w w  w . j  av  a 2s.c o m*/
    mHeader = header;
    mHeader.setOnHeaderClickListener(this);
    mPager = pager;
    mPager.setAdapter(this);
    mPager.setOnPageChangeListener(this);
}

From source file:org.coursera.android.shift.ShiftLauncherView.java

private void showTabsFragment(FragmentActivity activity) {
    FragmentManager manager = activity.getSupportFragmentManager();
    FragmentTransaction transaction = manager.beginTransaction();
    Fragment tabsFragment = manager.findFragmentByTag(TABS_TAG);
    if (tabsFragment == null || !tabsFragment.isAdded()) {
        TabsFragment tabs = TabsFragment.getNewInstance();
        addFragment(activity, tabs, TABS_TAG, true);
    } else {//from ww  w  .ja v a  2s  .c o m
        transaction.remove(manager.findFragmentByTag(TABS_TAG));
        transaction.commit();
        TabsFragment tabs = TabsFragment.getNewInstance();
        addFragment(activity, tabs, TABS_TAG, true);
    }
}

From source file:org.andstatus.app.SelectorDialog.java

public void show(FragmentActivity fragmentActivity) {
    FragmentTransaction ft = fragmentActivity.getSupportFragmentManager().beginTransaction();
    Fragment prev = fragmentActivity.getSupportFragmentManager().findFragmentByTag(dialogTag);
    if (prev != null) {
        ft.remove(prev);/*from  ww  w . ja va  2s .co  m*/
    }
    ft.addToBackStack(null);
    show(ft, dialogTag);
}

From source file:com.github.jksiezni.permissive.fragments.RationaleFragment.java

@Override
public void onShowRationale(Activity activity, String[] allowablePermissions, PermissiveMessenger messenger) {
    this.allowablePermissions = allowablePermissions;
    this.permissiveMessenger = messenger;

    if (isAdded()) {
        return;//from w w  w  .  j av a 2 s  .co m
    }
    if (activity instanceof FragmentActivity) {
        FragmentActivity fa = (FragmentActivity) activity;
        fa.getSupportFragmentManager().beginTransaction().add(android.R.id.content, this, null).commit();
    } else {
        throw new ClassCastException("This fragment (" + this
                + ") requires an instance of FragmentActivity to work, but was: " + activity);
    }
}