Android ViewPager automatically change page

后端 未结 3 1438
广开言路
广开言路 2020-12-04 20:26


I want to schedule an action to change automatically my ViewPager pages. I\'ve tried:

@Override
    public void onCreate(Bundle savedInstanceState) {
           


        
3条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 20:42

    The TimerTask will runs on it's own thread ( = not the UI thread).

    You can simply call setCurrentItem directly on the main thread using a Handler.

提交回复
热议问题