jPCT-AE - a 3d engine for Android > Bugs

Crash on Galaxy S3

<< < (2/2)

AugTech:
Ah.. The orientation is not changing anyway, due to
--- Code: ---android:screenOrientation="landscape"
--- End code ---
in the manifest.

Sorry for the confusion - The S3 is on Android 4.x.  My regular test/ dev device is an S2 which is on 2.3.3 - This has not shown the error, whereas the S3 has. Not sure how this fits with 4.x 'trying' to save the context...

EgonOlsen:

--- Quote from: AugTech on January 07, 2013, 10:30:09 pm ---Not sure how this fits with 4.x 'trying' to save the context...

--- End quote ---
Maybe it doesn't do this then...i'm left in that dark with all this context management of Android too. That's why i suggest to not rely on anything in this case and create a new buffer every time.

AugTech:
:( I'll loose those valuable 1.8 seconds I thought I'd gained onResume() - Better than not crashing though!

Thanks Egon.

AugTech:
As a footnote to this...

As I have to dispose and re-create the FrameBuffer each time, I thought I'd see if there were other ways to speed up the process.
I found that onSurfaceChanged() is actually being called twice, which I believe is an Android issue, and not mine.

Anyway, I've implemented a counter that is reset in the GLSurfaceView.onResume() method, so now when onSurfaceChanged() has been called once it isn't called again.  This is probably shaved 1/3 off the restart time.


--- Code: ---@Override
public void onSurfaceChanged(GL10 ignore, int width, int height) {
if (SURFACE_RESTART_COUNT > 0) return;
SURFACE_RESTART_COUNT++;
Globals.SCREEN_WIDTH = width;
Globals.SCREEN_HEIGHT = height;
if (frameBuffer!=null) frameBuffer.dispose();
        frameBuffer = new FrameBuffer(Globals.SCREEN_WIDTH, Globals.SCREEN_HEIGHT);

        Log.i(LOG_TAG,"Frame buffer set - w: "+ Globals.SCREEN_WIDTH + ", h: "+Globals.SCREEN_HEIGHT );
}

--- End code ---

Cheers.

EgonOlsen:
Every Android version seems to change that behaviour. When pressing the lock-button, my Galaxy Note calls: onPause, onStop, onDestroy (with isFinishing() returning false), onCreate, onResume, onPause and onResume. After all that, my game runs behind the lock screen.... :o

Navigation

[0] Message Index

[*] Previous page

Go to full version