这是我目前的代码:
gameListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if(position == plusPosition) //when plusSign is clicked
{
someGame = new Game(); //instance of game class
someGame.gameName = indicatedGameName;
arrayOfGames.add(0, someGame);
gameRowItem newGame = new gameRowItem(someGame.gameName);
GameRowItem.add(0, newGame);
adapter.notifyDataSetChanged();
plusPosition++;
}else{
Intent toGamePlay = new Intent(ListOfGames.this, GamePlay.class);
startActivity(toGamePlay);
}
}
});
每当我离开此活动然后返回此活动时,添加的细胞就会消失。即使您离开活动,我如何让细胞保存?提前感谢您提供的任何帮助。