Revision c0f27889
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/examples/generic/GenericActivity2.java | ||
---|---|---|
35 | 35 |
import org.distorted.library.main.DistortedEffects; |
36 | 36 |
import org.distorted.library.main.DistortedTexture; |
37 | 37 |
import org.distorted.library.mesh.MeshBase; |
38 |
import org.distorted.library.type.Static3D; |
|
39 | 38 |
import org.distorted.library.type.Static4D; |
40 | 39 |
|
41 | 40 |
import java.io.IOException; |
... | ... | |
116 | 115 |
{ |
117 | 116 |
is.close(); |
118 | 117 |
} |
119 |
catch(IOException e) { }
|
|
118 |
catch(IOException ignored) { }
|
|
120 | 119 |
} |
121 | 120 |
} |
122 | 121 |
else |
... | ... | |
280 | 279 |
@Override |
281 | 280 |
protected void onPause() |
282 | 281 |
{ |
283 |
GLSurfaceView mView = findViewById(R.id.genericSurfaceView); |
|
284 |
if( mView!=null ) mView.onPause(); |
|
285 |
|
|
286 |
DistortedLibrary.onPause(); |
|
287 | 282 |
super.onPause(); |
283 |
GLSurfaceView view = findViewById(R.id.genericSurfaceView); |
|
284 |
view.onPause(); |
|
285 |
DistortedLibrary.onPause(); |
|
288 | 286 |
} |
289 | 287 |
|
290 | 288 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
293 | 291 |
protected void onResume() |
294 | 292 |
{ |
295 | 293 |
super.onResume(); |
296 |
GLSurfaceView mView = findViewById(R.id.genericSurfaceView);
|
|
297 |
if( mView!=null ) mView.onResume();
|
|
294 |
GLSurfaceView view = findViewById(R.id.genericSurfaceView);
|
|
295 |
view.onResume();
|
|
298 | 296 |
} |
299 | 297 |
|
300 | 298 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
We need to pause an Activity in the following way:
1) Activity.onPause()
2) View.onPause()
3) Library.onPause()
otherwise sometimes there are artifacts when pausing!