Activity getFragmentManager - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:getActionBar, getFragmentManager
                args = _args;
            } 
        } 
 
        public TabsAdapter(Activity activity, ViewPager pager) {
            super(activity.getFragmentManager());
            mContext = activity;
            mActionBar = activity.getActionBar();
            mViewPager = pager;
            mViewPager.setAdapter(this);
            mViewPager.setOnPageChangeListener(this);
        } 
 
        public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) {
            TabInfo info = new TabInfo(clss, args);
            tab.setTag(info);
            tab.setTabListener(this);
            mTabs.add(info);
            mActionBar.addTab(tab);
            notifyDataSetChanged(); 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getActionBar, getFragmentManager
                args = _args;
            } 
        } 
 
        public TabsAdapter(Activity activity, ViewPager pager) {
            super(activity.getFragmentManager());
            mContext = activity;
            mActionBar = activity.getActionBar();
            mViewPager = pager;
            mViewPager.setAdapter(this);
            mViewPager.setOnPageChangeListener(this);
        } 
 
        public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) {
            TabInfo info = new TabInfo(clss, args);
            tab.setTag(info);
            tab.setTabListener(this);
            mTabs.add(info);
            mActionBar.addTab(tab);
            notifyDataSetChanged(); 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getFragmentManager
 */ 
public class Utils { 
 
    public static void showAbout(Activity activity) {
 
        FragmentManager fm = activity.getFragmentManager();
        FragmentTransaction ft = fm.beginTransaction();
        Fragment prev = fm.findFragmentByTag("dialog_about");
        if (prev != null) {
            ft.remove(prev);
        } 
        ft.addToBackStack(null);
 
        new AboutDialog().show(ft,"dialog_about");
    } 
 
    /** 
     * About Dialog 
     */ 
    public static class AboutDialog extends DialogFragment {
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getActionBar, getFragmentManager
                args = _args;
            } 
        } 
 
        public TabsAdapter(Activity activity, ViewPager pager) {
            super(activity.getFragmentManager());
            mContext = activity;
            mActionBar = activity.getActionBar();
            mViewPager = pager;
            mViewPager.setAdapter(this);
            mViewPager.setOnPageChangeListener(this);
        } 
 
        public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) {
            TabInfo info = new TabInfo(clss, args);
            tab.setTag(info);
            tab.setTabListener(this);
            mTabs.add(info);
            mActionBar.addTab(tab);
            notifyDataSetChanged(); 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getFragmentManager
		return saveImage(activity, src);
	} 
 
	@Override 
	protected void onCancelled() { 
		final FragmentManager fm = activity.getFragmentManager();
		final DialogFragment fragment = (DialogFragment) fm.findFragmentByTag(PROGRESS_FRAGMENT_TAG);
		if (fragment != null && fragment.isVisible()) {
			fragment.dismiss();
		} 
		super.onCancelled(); 
	} 
 
	@Override 
	protected void onPostExecute(final File result) {
		final FragmentManager fm = activity.getFragmentManager();
		final DialogFragment fragment = (DialogFragment) fm.findFragmentByTag(PROGRESS_FRAGMENT_TAG);
		if (fragment != null) {
			fragment.dismiss();
		} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getActionBar, getFragmentManager
                args = _args;
            } 
        } 
 
        public TabsAdapter(Activity activity, ViewPager pager) {
            super(activity.getFragmentManager());
            mContext = activity;
            mActionBar = activity.getActionBar();
            mViewPager = pager;
            mViewPager.setAdapter(this);
            mViewPager.setOnPageChangeListener(this);
        } 
 
        public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) {
            TabInfo info = new TabInfo(clss, args);
            tab.setTag(info);
            tab.setTabListener(this);
            mTabs.add(info);
            mActionBar.addTab(tab);
            notifyDataSetChanged(); 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getFragmentManager
            mArgs = args;
 
            // Check to see if we already have a fragment for this tab, probably 
            // from a previously saved state.  If so, deactivate it, because our 
            // initial state is that a tab isn't shown. 
            mFragment = mActivity.getFragmentManager().findFragmentByTag(mTag);
            if (mFragment != null && !mFragment.isDetached()) {
                FragmentTransaction ft = mActivity.getFragmentManager().beginTransaction();
                ft.detach(mFragment);
                ft.commit();
            } 
        } 
 
        public void onTabSelected(Tab tab, FragmentTransaction ft) {
            if (mFragment == null) {
                mFragment = Fragment.instantiate(mActivity, mClass.getName(), mArgs);
                ft.add(android.R.id.content, mFragment, mTag);
            } else { 
                ft.attach(mFragment);
            } 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getActionBar, getFragmentManager
                args = _args;
            } 
        } 
 
        public TabsAdapter(Activity activity, ViewPager pager) {
            super(activity.getFragmentManager());
            mContext = activity;
            mActionBar = activity.getActionBar();
            mViewPager = pager;
            mViewPager.setAdapter(this);
            mViewPager.setOnPageChangeListener(this);
        } 
 
        public void addTab(ActionBar.Tab tab, Class<?> clss, Bundle args) {
            TabInfo info = new TabInfo(clss, args);
            tab.setTag(info);
            tab.setTabListener(this);
            mTabs.add(info);
            mActionBar.addTab(tab);
            notifyDataSetChanged(); 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getAdapter, getCurrentItem, setCurrentItem
 
    /** 
     * Hack to enable reloading fragments while they are being viewed 
     */ 
    public void forceReload() { 
        int position = getCurrentItem();
        setAdapter(getAdapter()); 
        setCurrentItem(position, false);
    } 
 
    /** 
     * Show the supplied filter, adding it to the data source if it doesn't exist 
     * @param f 
     */ 
    public void showFilter(Filter f) { 
        TaskListFragmentPagerAdapter adapter = (TaskListFragmentPagerAdapter) getAdapter();
        showFilter(adapter.addOrLookup(f));
    } 
 
    /** 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
import android.view.MotionEvent; 
 
public class NestableViewPager extends ViewPager { 
 
    public NestableViewPager(Context context, AttributeSet attrs) { 
        super(context, attrs); 
    } 
 
    /** 
     * Prevent horizontal scrolling 
     */ 
     @Override 
    public boolean onInterceptTouchEvent(MotionEvent event) { 
         return false; 
    } 
 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Activity getFragmentManager Questions & Answers:

Other Activity getFragmentManager Examples

21:	    super.onCreate(savedInstanceState);
22:	    setContentView(R.layout.activity_main);
23:	    map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
24:	        .getMap();
25:	    Marker hamburg = map.addMarker(new MarkerOptions().position(HAMBURG)

Read More

187:	
188:			if (fragment != null) {
189:				FragmentManager fragmentManager = getFragmentManager();
190:				fragmentManager.beginTransaction()
191:						.replace(R.id.frame_container, fragment).commit();

Read More

51:	
52:			if (fragment != null) {
53:				FragmentManager fragmentManager = getFragmentManager();
54:				fragmentManager.beginTransaction()
55:						.replace(R.id.frame_container, fragment).commit();

Read More

23:		private void initilizeMap() {
24:			if (googleMap == null) {
25:				googleMap = ((MapFragment) getFragmentManager().findFragmentById(
26:						R.id.map)).getMap();
27:

Read More

getFragmentManager Method Overview
Return the FragmentManager for interacting with fragments associated with this activity.
See Code Examples for other Android Activity Methods: