How to move the first position of the image to the second position in the listView on the button click on android


How to move the first position of image to second position in ListView on Button click,so that last position of image will comes to first position.

my tried codes below;

public class MainActivity extends AppCompatActivity {

private int[] images = {R.drawable.img1,R.drawable.img2,R.drawable.img3,R.drawable.img4,R.drawable.img5};
ArrayList<ImageModel> imageModels;

protected void onCreate (Bundle savedInstanceState) {
    super.onCreate (savedInstanceState);
    setContentView (R.layout.activity_main);

    imageModels = new ArrayList<ImageModel> ();
    for (int i = 0; i < images.length; i++) {
        ImageModel imgMode = new ImageModel ();
        imgMode.setImageId (images[i]);
        imageModels.add (imgMode);
        Log.d ("chk",""+images[i]);

    ListView lstView = (ListView)findViewById (;
    lstView.setAdapter (new BaseAdapterr(MainActivity.this,imageModels));

    Button btnClick = (Button)findViewById (;
    btnClick.setOnClickListener (new View.OnClickListener () {
        public void onClick (View v) {
           for (int i=0 ;i < imageModels.size ();i++){

Try using getting the object index and then use setIndex or sth like that for changing index.