Android - Circular array display

view story

http://stackoverflow.com – I have a array of cities - String[] cities = { "Riyadh", "Jubail", "Jeddah", "Madinah", "Tabuk","Bangalore","Chennai","Pune" }; I am displaying them in a list that has three textview(fixed) . This means we are going to display three cities at a time. Here is the method to display the cities. void setUpCityList(int iCity) { tvOneCity.setText(cities[iCity]); tvTwoCity.setText(cities[iCity + 1]); tvThreeCity.setText(cities[iCity + 2]); } When the user swipes up ,i am incrementing the index and the user swipes down i am decrementing the index. void swipeUp() { (HowTos)