title: Extend clickCount to more than 2 items
body: <p>I am learning to create Android widget following the tutorial from <a href="https://looksok.wordpress.com/2012/12/15/android-complete-widget-tutorial-including-source-code/" rel="nofollow">https://looksok.wordpress.com/2012/12/15/android-complete-widget-tutorial-including-source-code/</a></p>
  
  <p>Tutorial showed how to build android widget with one button and image. Button press will change the image displayed.</p>
  
  <pre><code>public class MyWidgetIntentReceiver extends BroadcastReceiver {
  
  private static int clickCount = 0;
  
  @Override
  public void onReceive(Context context, Intent intent) {
      if(intent.getAction().equals("pl.looksok.intent.action.CHANGE_PICTURE")){
          updateWidgetPictureAndButtonListener(context);
      }
  }
  
  private void updateWidgetPictureAndButtonListener(Context context) {
      RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget_demo);
      remoteViews.setImageViewResource(R.id.widget_image, getImageToSet());
  
      //REMEMBER TO ALWAYS REFRESH YOUR BUTTON CLICK LISTENERS!!!
      remoteViews.setOnClickPendingIntent(R.id.widget_button, MyWidgetProvider.buildButtonPendingIntent(context));
  
      MyWidgetProvider.pushWidgetUpdate(context.getApplicationContext(), remoteViews);
  }
  
  private int getImageToSet() {
      clickCount++;
      return clickCount % 2 == 0 ? R.drawable.me : R.drawable.wordpress_icon;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>What I want to do is to extend the <code>clickCount</code> to multiple (12 images). The author commented that:
  Put drawables in an ArrayList and after button click get the drawable corresponding to clickCount
  Remember to reset counter if it reaches ArrayList’s size to avoid IndexOutOfBounds exception</p>
  
  <p>But I really have no idea on how to do this since I have only beginning knowledge in Java and Android development.</p>