Log in or register to post comments

Error in close application or press back button

November 9, 2012 - 8:10pm #6

i have a problem. i make some application start with imagetarget.i can add button and show and hide it.show a text and so on.but when i close or press back button, the apllication is termintated with error force closed. anyone can help?

Error in close application or press back button

November 11, 2012 - 5:21am #5

There can be lots of reasons for a crash upon back button; it really depends what is in your app code;

the best I can recommend is to debug the problem by placing some logs at key places of your activity life-cycle, i.e. in the following functions:

- onResume()

- onPause() 

- onCreate()

- onDestroy()

In particular, the onPause() method will certainly be triggered when you press back, so you might want to check there at which point the crash occurs (e.g. before or after calling QCAR.onPause, etc.)

A Log of your crash would also help.

 

 

Error in close application or press back button

November 11, 2012 - 6:40am #4

yes. my method deinitbutton and native clear in on pause method....i iwill try it. my app now can be show text and button but, if i move to another marker the button and the text always show and if not recognise the marker, the text and button before always show.can button and text can be show if in multiply target or marker? if multiply target ca only show one text.thnks

Error in close application or press back button

November 11, 2012 - 8:52am #3

Hi, if I remember correctly from one of your previous posts, you compare the trackable->getId()  with  a variable called "lastTrackableId", is it correct ?

So, one simple way of getting rid of the previous message when there is no tracking of any trackable, is to reset the lastTrackableId to -1, 

i.e. in the _renderFrame function, right before the "for" loop where you iterate on state.getNumActiveTrackables(),  add the following:

 

    if (state.getNumActiveTrackables() == 0)

    {

    lastTrackableId = -1;

    }

   

Then update your Java code so to NOT display any message when receiving a message from C++ that has an ID = -1.

I hope this helps.

 

Error in close application or press back button

November 11, 2012 - 12:48pm #2

thank u..this is so help me and it' works....

Error in close application or press back button

November 12, 2012 - 12:58am #1

You're welcome.

Log in or register to post comments