Page 1 of 1

Android Back Button

Posted: Tue Jul 11, 2017 9:18 am
by Arclamp
When a user presses the back button on Android, the app disappears as expected, however when the app is restarted the gui is not being rendered, yet it works fine when change task back and forth.

At the end of the code after my loop is finished and the app exits (after back pressed), if I use the following then the app is properly destroyed and when restarted its starts as if fresh. But, I always get a msg stating the "app has stopped running"

Code: Select all

 
    ... a_main(android_app* app=NULL) ...
    
    ...
    
    if(app){
        delete app;
        app = NULL;
    }
 
Any tips on what to do please?

I understand that an app shouldn't really be closed other than by the system itself.

Am I supposed to use "android_app" struct to access "something", etc...

Cheers

Re: Android Back Button

Posted: Tue Jul 11, 2017 9:31 am
by Arclamp
It appears that a normal exit works as required...

Code: Select all

 
exit(0);
 
Any other tips?

Thanks

Re: Android Back Button

Posted: Tue Jul 11, 2017 11:30 am
by CuteAlien
Does this also fail for you with the Irrlicht example? Are you using the latest ogl-es version in svn (because there had been a a fix in that area not too long ago)?

Re: Android Back Button

Posted: Tue Jul 11, 2017 2:00 pm
by Arclamp
r5498

Just tried, no that works fine and along with the static counter too.


I think its me and mine, but I can't find where I may be releasing items. I have dumped in a fair few other classes today, but not finding who, what, where, when... but if you saying shouldn't, then I'll continue on looking.

Thankyou

Re: Android Back Button

Posted: Tue Jul 11, 2017 2:36 pm
by CuteAlien
Ehm... not saying Irrlicht isn't to blame in some way. I have only written a single app for Android and that's a while ago already. And there tend to be a *lot* of device specific troubles on Android. But if example works then you always have some chance at least comparing to that. I guess I also should try and compile & test my game again some time with new Irrlicht versions.

Re: Android Back Button

Posted: Tue Jul 11, 2017 3:34 pm
by Arclamp
This is me too, I hadn't touched my Android version for months