Android Back Button

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Arclamp
Posts: 71
Joined: Thu Oct 10, 2013 7:45 pm

Android Back Button

Post 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
Arclamp
Posts: 71
Joined: Thu Oct 10, 2013 7:45 pm

Re: Android Back Button

Post by Arclamp »

It appears that a normal exit works as required...

Code: Select all

 
exit(0);
 
Any other tips?

Thanks
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Android Back Button

Post 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)?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Arclamp
Posts: 71
Joined: Thu Oct 10, 2013 7:45 pm

Re: Android Back Button

Post 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
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Android Back Button

Post 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.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Arclamp
Posts: 71
Joined: Thu Oct 10, 2013 7:45 pm

Re: Android Back Button

Post by Arclamp »

This is me too, I hadn't touched my Android version for months
Post Reply