title: My simple app is skipping a lot of frames. (Imageview and Imagebutton)
body: <p>I'm extremely new to Android programming. Right now I'm building a <em>very</em> simple app so i can get the hang of things.  </p>
  
  <p>Basically i have:<br>
  - Background<br>
  - <code>ImageView</code><br>
  - <code>ImageButton</code>.  </p>
  
  <p>Every time I click the <code>ImageButton</code>, it cycles through a list of images I have stored in an array. However I'm ending up skipping a lot of frames.  </p>
  
  <pre><code>    private static ImageButton button;
      private static ImageView current;
      private int index;
      int[] images = {R.drawable.image1, R.drawable.image2};
  
      public void buttonClick() {
          current = (ImageView)findViewById(R.id.imageView);
          button = (ImageButton)findViewById(R.id.imageButton);
          button.setOnClickListener(
                  new View.OnClickListener() {
                      @Override
                      public void onClick(View v) {
                          current.setImageResource(images[index]);
                          if(index == (images.length - 1)) {
                              index = 0;
                          }
                          else {
                              index++;
                          }
                      }
                  }
          );
      }
  </code></pre>
  
  <p>Any idea what is causing it to skip frames, and what I can do to fix it? Is it because my image files are too big? They are about 788kb each and 1920x1120.  </p>
  
  <p>Thank you.   </p>