Created
August 29, 2019 07:51
-
-
Save aria-dev/a2ea1756feb5fe009590c6a326919427 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Auto start of viewpager | |
getActivity().runOnUiThread(new Runnable() { | |
@Override | |
public void run() { | |
// Auto start of viewpager | |
final Handler handler = new Handler(); | |
final Runnable Update = new Runnable() { | |
public void run() { | |
if (currentPage == NUM_PAGES) { | |
currentPage = 0; | |
} | |
mPager.setCurrentItem(currentPage++, true); | |
} | |
}; | |
Timer swipeTimer = new Timer(); | |
swipeTimer.schedule(new TimerTask() { | |
@Override | |
public void run() { | |
handler.post(Update); | |
} | |
}, 3000, 3000); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment