This is a simple image switcher for practicing ImageView in Android studio.
- ImageView width and height is set to activity parent size.
- Six dog images used as default.
- Basic button used for switching.
- Images repeat after the last image is displayed
- Clone or Download the project to your PC/Laptop.
- Open Android Studio
- Select the option "Open an existing Android Studio project"
- Locate the project folder in your directory.
- Select your target device.
- Select menu
Run -> Run 'app'
- Copy the image files to drawable folder in res folder. (Make sure that image filenames do not have characters like '-' or space)
- Open the file
MainActivity.java
file. - Add image refernence id inside the curly braces
images = new int[] {R.drawable.dog1, ... R.drawable.dog6};
- Thats it!