Created
September 29, 2016 18:20
-
-
Save anonymous/39e359fe5672df1c3a8e0ebb578b4c37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int size = pics_array.length; | |
/* this method called when the forward button clicked (for testing) */ | |
public void go (View view) { | |
if (index < size - 1) { | |
index++; | |
default_Pic.setImageResource(pics_array[index]); | |
}else { | |
index = 0; | |
default_Pic.setImageResource(pics_array[index]); | |
} | |
} | |
/* this method called when the back button clicked (for testing) +++need fixing+++ */ | |
public void back (View view) { | |
if (index <= 0) { | |
index = size - 1 ; | |
default_Pic.setImageResource(pics_array[index]); | |
}else { | |
index--; | |
default_Pic.setImageResource(pics_array[index]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment