title: How to change images in imageview every n number of seconds
body: <p>I have made an array that has all the images in int and  i want to change those images every 3 seconds in the imageView, I have tries all the solutions I could find but was showing some error, I can't figure it out .       </p>
  
  <p>java file (home.java)</p>
  
  <pre><code>/**
  * Created by sukhvir on 17/04/2015.
  */
  public class home extends android.support.v4.app.Fragment {
  
      ImageView MyImageView;
      int[] imageArray = { R.drawable.image1, R.drawable.image2, R.drawable.image3, R.drawable.image4, R.drawable.image5 };
  
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          /**
           * Inflate the layout for this fragment
          */
          return inflater.inflate(R.layout.home, container, false);
      }
  }
  </code></pre>
  
  <p>xml file(home.xml)</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;ImageView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/imageView"
          android:layout_gravity="center_horizontal" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>