Android FragmentPagerAdapter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android FragmentPagerAdapter class.

This code example shows how to use the following methods:
                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
This code example shows how to use the following methods:
                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
This code example shows how to use the following methods:
    int mCurPos;
 
    class MyPagerAdapter extends FragmentPagerAdapter implements ViewPager.OnPageChangeListener { 
 
        public MyPagerAdapter(FragmentManager fm) {
            super(fm);
        } 
 
        @Override 
        public Fragment getItem(int position) {
            return new AppOpsCategory(sPageTemplates[position]);
        } 
 
        @Override 
        public int getCount() { 
            return sPageTemplates.length;
        } 
 
        @Override 
        public CharSequence getPageTitle(int position) {
6
CodeRank
This code example shows how to use the following methods:notifyDataSetChanged
            TabInfo info = new TabInfo(clss, args);
            tab.setTag(info);
            tab.setTabListener(this);
            mTabs.add(info);
            mActionBar.addTab(tab);
            notifyDataSetChanged(); 
        } 
 
        @Override 
        public int getCount() { 
            return mTabs.size();
        } 
 
        @Override 
        public Fragment getItem(int position) {
            TabInfo info = mTabs.get(position);
            return Fragment.instantiate(mContext, info.clss.getName(), info.args);
        } 
 
        @Override 
6
CodeRank
This code example shows how to use the following methods:notifyDataSetChanged
            TabInfo info = new TabInfo(clss, args);
            tab.setTag(info);
            tab.setTabListener(this);
            mTabs.add(info);
            mActionBar.addTab(tab);
            notifyDataSetChanged(); 
        } 
 
        @Override 
        public int getCount() { 
            return mTabs.size();
        } 
 
        @Override 
        public Fragment getItem(int position) {
            TabInfo info = mTabs.get(position);
            return Fragment.instantiate(mContext, info.clss.getName(), info.args);
        } 
 
        @Override 
6
CodeRank
This code example shows how to use the following methods:notifyDataSetChanged
        TabInfo info = new TabInfo(clss, args);
        tab.setTag(info);
        tab.setTabListener(this);
        mTabs.add(info);
        mActionBar.addTab(tab);
        notifyDataSetChanged(); 
    } 
 
    @Override 
    public int getCount() { 
        return mTabs.size();
    } 
 
    @Override 
    public Fragment getItem(int position) {
        TabInfo info = mTabs.get(position);
        return Fragment.instantiate(mContext, info.clss.getName(), info.args);
    } 
 
    public int getCurrentTab() { 
6
CodeRank
This code example shows how to use the following methods:notifyDataSetChanged
            String tag = tabSpec.getTag();
 
            TabInfo info = new TabInfo(tag, clss, args);
            mTabs.add(info);
            mTabHost.addTab(tabSpec);
            notifyDataSetChanged(); 
        } 
 
        @Override 
        public int getCount() { 
            return mTabs.size();
        } 
 
        @Override 
        public Fragment getItem(int position) {
            TabInfo info = mTabs.get(position);
            return Fragment.instantiate(mContext, info.clss.getName(), info.args);
        } 
 
        @Override 
7
CodeRank
This code example shows how to use the following methods:notifyDataSetChanged
		TabInfo info = new TabInfo(clss, args);
		tab.setTag(info);
		tab.setTabListener(this);
		mTabs.add(info);
		mActionBar.addTab(tab);
		notifyDataSetChanged(); 
	} 
 
	@Override 
	public int getCount() { 
		return mTabs.size();
	} 
 
	@Override 
	public Fragment getItem(int position) {
		TabInfo info = mTabs.get(position);
		return Fragment.instantiate(mContext, info.clss.getName(),
				info.args);
	} 
 
7
CodeRank
This code example shows how to use the following methods:
                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
This code example shows how to use the following methods:notifyDataSetChanged
        super(manager);
    } 
 
    public void addFragment(Fragment fragment) {
        mFragments.add(fragment);
        notifyDataSetChanged(); 
    } 
 
    @Override 
    public int getCount() { 
        return mFragments.size();
    } 
 
    @Override 
    public Fragment getItem(int position) {
        return mFragments.get(position);
    } 
 
} 
7
CodeRank
See Code Examples for Android FragmentPagerAdapter Methods: