Project

General

Profile

« Previous | Next » 

Revision e52f9d96

Added by Leszek Koltunski almost 8 years ago

Fix a bug in PlainMonaLisa - avoid a crash on screen rotate

View differences:

src/main/java/org/distorted/examples/plainmonalisa/PlainMonaLisaSurfaceView.java
31 31
  {
32 32
  private static final String TAG = "MonaLisaSurface";
33 33
  private RenderThread mRenderThread;
34
  private static volatile boolean mPaused = true;
34 35

  
35 36
///////////////////////////////////////////////////////////////////////////////////////////////////
36 37

  
......
110 111

  
111 112
  public void onPause()
112 113
    {
114
    mPaused = true;
115

  
113 116
    Log.d(TAG, "onPause unhooking choreographer");
114 117
    Choreographer.getInstance().removeFrameCallback(this);
115 118
    }
......
118 121

  
119 122
  public void onResume()
120 123
    {
124
    mPaused = false;
125

  
121 126
    if (mRenderThread != null)
122 127
      {
123 128
      Log.d(TAG, "onResume re-hooking choreographer");
......
125 130
      }
126 131
    }
127 132

  
133
///////////////////////////////////////////////////////////////////////////////////////////////////
134

  
135
  public static boolean isPaused()
136
    {
137
    return mPaused;
138
    }
139

  
128 140
///////////////////////////////////////////////////////////////////////////////////////////////////
129 141

  
130 142
  @Override

Also available in: Unified diff