Revision 5e307a01
Added by Leszek Koltunski over 5 years ago
src/main/java/org/distorted/magic/RubikActivity.java | ||
---|---|---|
46 | 46 |
{ |
47 | 47 |
super.onCreate(savedState); |
48 | 48 |
setContentView(R.layout.layout); |
49 |
|
|
50 |
if( savedState==null ) |
|
51 |
{ |
|
52 |
markButton(DEFAULT_SIZE); |
|
53 |
} |
|
49 |
markButton(mSize); |
|
54 | 50 |
} |
55 | 51 |
|
56 | 52 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
83 | 79 |
super.onDestroy(); |
84 | 80 |
} |
85 | 81 |
|
86 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
87 |
|
|
88 |
@Override |
|
89 |
public void onSaveInstanceState(Bundle savedInstanceState) |
|
90 |
{ |
|
91 |
super.onSaveInstanceState(savedInstanceState); |
|
92 |
savedInstanceState.putInt("size", mSize ); |
|
93 |
} |
|
94 |
|
|
95 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
96 |
|
|
97 |
@Override |
|
98 |
public void onRestoreInstanceState(Bundle savedInstanceState) |
|
99 |
{ |
|
100 |
super.onRestoreInstanceState(savedInstanceState); |
|
101 |
|
|
102 |
int size = savedInstanceState.getInt("size"); |
|
103 |
markButton(size); |
|
104 |
} |
|
105 |
|
|
106 | 82 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
107 | 83 |
|
108 | 84 |
static int getSize() |
Also available in: Unified diff
Simplify.