Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try Like this: </p> <pre><code> @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.viewpager); // Create our custom adapter to supply pages to the viewpager. mPagerAdapter = new Pager_Adapter(this,getSupportFragmentManager()); mViewPager = (ViewPager)findViewById(R.id.pager); mViewPager.setAdapter(mPagerAdapter); // Start at a custom position mViewPager.setCurrentItem(0); // Find the indicator from the layout mTabs = (TitleIndicator) findViewById(R.id.swipeytabs); mTabs.setAdapter(mPagerAdapter); // Set the indicator as the pageChangeListener mViewPager.setOnPageChangeListener(mTabs); } class Pager_Adapter extends FragmentPagerAdapter implements ViewpagerAdapter{ private final Context mContext; public Pager_Adapter(Context context, FragmentManager fm) { super(fm); this.mContext = context; } @Override public Fragment getItem(int pos) { return ItemFragment.newInstance(QUES[pos],listArray[pos]); //return ItemFragment.newInstance(QUES[pos % TITLES.length]); } @Override public int getCount() { return TITLES.length; } public TextView getTab(final int position, TitleIndicator root) { TextView view = (TextView) LayoutInflater.from(mContext).inflate( R.layout.swipey_tab_indicator, root, false); // swipey_tab_indicator is the your titleBar Layout , // You can use only textview on that layout for the titlebar view.setText(TITLES[position]); view.setOnClickListener(new OnClickListener() { public void onClick(View v) { mViewPager.setCurrentItem(position); } }); return view; } } </code></pre> <p>For the more Information check this <a href="https://github.com/JakeWharton/Android-ViewPagerIndicator/tree/master/sample/src/com/viewpagerindicator/sample" rel="nofollow">link</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload