title: Circle Indicator in Viewpager in android
body: <p>Im new in android , In my application I am using  circle indicator.but I don know how to add it.. can anyone please tell me how to add circle indicator in my code.Here is my code</p>
  
  <pre><code>public class WalkthroughActivity extends Activity {
  
      private static final int MAX_VIEWS = 5;
  
      ViewPager mViewPager;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
  
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          mViewPager = (ViewPager) findViewById(R.id.pager);
          mViewPager.setAdapter(new WalkthroughPagerAdapter());
          mViewPager.setOnPageChangeListener(new WalkthroughPageChangeListener());
      }
  
  
      class WalkthroughPagerAdapter extends PagerAdapter {
  
          @Override
          public int getCount() {
              return MAX_VIEWS;
          }
  
          @Override
          public boolean isViewFromObject(View view, Object object) {
              return view == (View) object;
          }
  
          @Override
          public Object instantiateItem(View container, int position) {
              Log.e("walkthrough", "instantiateItem(" + position + ");");
              LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              View imageViewContainer = inflater.inflate(R.layout.activity_view_pager, null);
              ImageView imageView = (ImageView) imageViewContainer.findViewById(R.id.imageView1);
  
              switch(position) {
              case 0:
                  imageView.setImageResource(R.drawable.kierkegaarddrop);
                  break;
  
              case 1:
                  imageView.setImageResource(R.drawable.nature);
                  break;
  
              case 2:
                  imageView.setImageResource(R.drawable.path);
                  break;
  
              case 3:
                  imageView.setImageResource(R.drawable.supportlife);
                  break;
  
              case 4:
                  imageView.setImageResource(R.drawable.willow);
                  break;
              }
  
              ((ViewPager) container).addView(imageViewContainer, 0);
              return imageViewContainer;
          }
  
          @Override
          public void destroyItem(ViewGroup container, int position, Object object) {
              ((ViewPager)container).removeView((View)object);
          }
      }
  
  
      class WalkthroughPageChangeListener implements ViewPager.OnPageChangeListener {
  
          @Override
          public void onPageScrollStateChanged(int arg0) {
  
          }
  
          @Override
          public void onPageScrolled(int arg0, float arg1, int arg2) {
  
          }
  
          @Override
          public void onPageSelected(int position) {
              // Here is where you should show change the view of page indicator
              switch(position) {
  
              case MAX_VIEWS - 1:
                  break;
  
              default:
  
              }
  
          }
  
      }
  </code></pre>