I have a listView
(for player names entered in the edittext on my loginpage). My second activity page (the actual game refers to those player names (projects the first of the list top of the screen as can be seen here:
In order to do so, I created the following intent on the loginpage:
public void openActivity2() {
Intent intent = new Intent(this, Gamescreen.class);
String s= list.get(0);
intent.putExtra("Name1", s);
startActivity(intent);
}}
In the game screen I refer to this as such:
Intent iin= getIntent();
Bundle b = iin.getExtras();
if(b!=null)
{
String j =b.getString("Name1");
playerturn.setText(j);
}
Basically what I want is that when I press the button (next player) on the gamescreen that it moves from the first player name on the list to the second. As such as you keep clicking the next player button -> you move down the list.
I will need to make an onclicklistener for the click of the button, but how do I make the rest possible, with the current way I have approached it? Help much appreciated!