processing-android
processing-android copied to clipboard
onPause() not possible.
Hi. In the simple sketch below I can not use even an empty onPause(). If I do use it, and press the home button, and then recall the program it will only give a blue screen without text. If I use the back button or rotate the device this error will not happen.
void setup() {
fullScreen();
orientation(PORTRAIT);
background(0,0,255);
textAlign(CENTER);
textSize(45);
text("Hello world", width/2, height/2);
}
void draw() {
}
void onCreate() {
}
void onStart() {
}
// void onPause() {
// }
void onStop() {
}
void onResume() {
super.onResume();
}
void onRestart() {
}
As with #531, I had a hard time handling tricky situations like this. I believe it is related to how Android manages the framebuffer, if the app's view is not continuously updating then it may not be possible to restore the last rendered frame correctly. I tried a number of things to deal with this (saving the frame to a temporary file when the app gets send to the background, for example), but have not been able to find a solution that works consistently all the time.