// adapterには、表示用の配列またはArrayListが設定されていること
viewPager.setAdapter(adapter);
// positionにページのindex値を指定
// 遅延処理をしないと、index値が1~4の場合、0ページが表示されてしまう
viewPager.postDelayed(() -> viewPager.setCurrentItem(position), 50);
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme