 viewPager = (ViewPager) findViewById(R.id.pager); ImagePagerAdapter adapter = new ImagePagerAdapter(); viewPager.setAdapter(adapter); viewPager.setCurrentItem(0);  private class ImagePagerAdapter extends PagerAdapter{      @Override     public int getCount() {         