Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can I do set setCurrentItem function? #22

Open
S-Masoud-Emamian opened this issue Mar 24, 2015 · 1 comment
Open

how can I do set setCurrentItem function? #22

S-Masoud-Emamian opened this issue Mar 24, 2015 · 1 comment

Comments

@S-Masoud-Emamian
Copy link

Hi

how can I do set setCurrentItem function?

after below code I get some errors :

 mViewPager.setCurrentItem(3);

errors :

at com.kmshack.newsstand.MainActivity.onPageSelected(MainActivity.java:145)
        at     com.astuetz.PagerSlidingTabStrip$PageListener.onPageSelected(PagerSlidingTabStrip.java:387)
        at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:548)
        at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:514)
        at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:495)
        at     com.kmshack.newsstand.MainActivity.onCreate(MainActivity.java:126)//mViewPager.setCurrentItem(3);
@S-Masoud-Emamian
Copy link
Author

Solved :

       new Handler().postDelayed(new Runnable() {
         @Override
         public void run() {
             mViewPager.setCurrentItem(3);
          }
     },500);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant