I'm trying for hours to save & restore TextView and Buttons. It seems that I'm not able to save TextView because "outState" requires a String.
I made a TicTacToe game but I want to save all the stuffs when orientation is "landscape"
Here is a part of what I'm trying to do :
private Button lesBoutons[];
private Button rejouer;
private Jeu jeu;
private TextView leTexte;
private int[] tabGagne;
public boolean fini;
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.PutString("savText", leTexte);
//TextView savTexte = leTexte;
//String phrase=leTexte.toString();
//outState.putString("TEST", phrase);
//leTexte.getResources();
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
// leTexte.setText(savedInstanceState.getString("TEST"));
}
How can I save this TextViews and all the buttons ?