Project

General

Profile

« Previous | Next » 

Revision 4f36e418

Added by Leszek Koltunski almost 4 years ago

Hopefully get rid of the most common crash in the field right now by changing the States to always create all their Views from scratch.

View differences:

src/main/java/org/distorted/states/RubikStateSolution.java
73 73
    layoutTop.addView(text);
74 74

  
75 75
    // BOT ////////////////////////////
76
    if( mPrevButton==null ) setupPrevButton(act,scale);
77
    if( mNextButton==null ) setupNextButton(act,scale);
78
    if( mMovesText ==null ) setupTextView(act,scale);
76
    setupPrevButton(act,scale);
77
    setupNextButton(act,scale);
78
    setupTextView(act,scale);
79 79

  
80 80
    LinearLayout layoutLeft = act.findViewById(R.id.mainBarLeft);
81 81
    layoutLeft.removeAllViews();
......
83 83
    layoutLeft.addView(mMovesText);
84 84
    layoutLeft.addView(mNextButton);
85 85

  
86
    if( mBackButton==null ) setupBackButton(act,scale);
86
    setupBackButton(act,scale);
87 87

  
88 88
    LinearLayout layoutRight = act.findViewById(R.id.mainBarRight);
89 89
    layoutRight.removeAllViews();
......
266 266

  
267 267
  public void savePreferences(SharedPreferences.Editor editor)
268 268
    {
269
    mBackButton= null;
270
    mPrevButton= null;
271
    mNextButton= null;
272
    mMovesText = null;
269

  
273 270
    }
274 271

  
275 272
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff