processing-android icon indicating copy to clipboard operation
processing-android copied to clipboard

avoid sketch restart on orientation change

Open processing-bugs opened this issue 11 years ago • 7 comments

Issue by processing-bugs Sunday May 12, 2013 at 21:41 GMT Originally opened as https://github.com/processing/processing-android-archive/issues/4


Moved from here: https://github.com/processing/processing/issues/1640

processing-bugs avatar Jul 18 '14 17:07 processing-bugs

I'm writing this out for the benefit of people who, like myself, had been following one of the threads this was reassigned from.

I found it odd that the "(SMOOTH) is not supported by this device" error was re-assigned here. But they are evidently interrelated. When using hardware rendering (P2D, P3D, OPENGL), and orientation(PORTRAIT/LANDSCAPE) the sketch crashes on some devices where the orientation is non-default. Remove the call to orientation, and the sketch will boot but crash when you rotate the device.

When using software rendering (JAVA2D), orientation() works without crashing. However, not calling orientation() still results in a crash when the device is rotated.

In any case it appears that it is the restart on rotation, not the SMOOTH error that results in the crash.

ZachSundberg avatar Oct 11 '14 14:10 ZachSundberg

Has this issue been resolved? I am having this issue with my Galaxy S3 with Android 4.3 and Processing 2.0.3 for Mac OSX 10.9. I am specifying landscape orientation in the code. Unless I start it in that orientation, it crashes.

scottlittle avatar Feb 28 '15 17:02 scottlittle

I'm now running 3.0a4 (alpha) and it appears to have been resolved. I'm now running all my apps using P2D without issues.

ZachSundberg avatar Feb 28 '15 17:02 ZachSundberg

I forgot to mention that I'm using P3D. I'll give the alpha version a shot and get back.

scottlittle avatar Feb 28 '15 20:02 scottlittle

Processing 3.0 with Android mode 3.0 did not work. It compiled but crashed upon launch. It complained about something about putting stuff outside the renderer. I was able to get it to work by reverting back to Processing 2.0.3 and its prepackaged Android mode, removing the orientation(LANDSCAPE) line and adding android:screenOrientation="landscape" in the XML file as described here: http://forum.processing.org/two/discussion/157/landscape-with-opengl-renderer-on-nexus-4#Item_5.

scottlittle avatar Mar 01 '15 23:03 scottlittle

If not already implemented in a current version, would it be possible to change the orientation code to add the line to XML file through the preprocessor?

scottlittle avatar Mar 02 '15 08:03 scottlittle

Hi,

Does this issue require the implementation of the activity life cycle to the sketch rendering classes to resolve it?

sgsh123 avatar Feb 24 '17 20:02 sgsh123