Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
dmitry_nezhevenko
Posts: 8
Registered: ‎05-20-2013
My Device: -

Asking headless app to quit on close

Hi,


I'm using long-running headless app for some background stuff. At the same time at certain conditions I want to be able to ask headless part to quit when user closes UI.

Headless app is triggered using invocation framework. I've added Application::manualExit() signal handler (together with setAutoExit(false) which just sends special 'Quit' invocation to headless. And once finished calls Application::quit().


Unfortunately this way doesn't work. For some unknown reason I'm getting err=2 (BadRequest) with errorCode=4100. Headless part doesn't receive notification. If I change my app to call same code from other context (without using manualExit signal, for example by adding own 'exit' button to QML) everything works.

 

Any ideas? Is there any other way to make sure that headless app exits when UI is closed under certain conditions?

Please use plain text.
Developer
Benecore
Posts: 540
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....

Re: Asking headless app to quit on close

Don't know if it will works on headless app, but you can try it

http://supportforums.blackberry.com/t5/Native-Development/App-quit-dialog-How-to-make-one/m-p/287157...



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Please use plain text.
New Developer
dmitry_nezhevenko
Posts: 8
Registered: ‎05-20-2013
My Device: -

Re: Asking headless app to quit on close

Hi,

thanks for your answer.

 

I'm not asking about 'how to detect when app closes'. The issue I've found is that once user tried to close app (by pressing 'X' button on app frame), invocation framework stops working...

Please use plain text.
Developer
Benecore
Posts: 540
Registered: ‎08-31-2013
My Device: Q10, Z10LE, Nokia N950, DAB....

Re: Asking headless app to quit on close

Aha, I just got up :Oops:



If helped give a like. If your problem was solved mark the post as "Solution"
Portfolio: BlackBerry Nokia
Social: Twitter | Facebook
About Me / Blog DevPDA | Blog
Please use plain text.
New Developer
dmitry_nezhevenko
Posts: 8
Registered: ‎05-20-2013
My Device: -

Re: Asking headless app to quit on close

It looks like it's even more tricky.

I've tried to reproduce it without headless stuff at all. Instead I'm trying to invoke standard browser.

 

It also works well if triggered by QML. But once I put same code to 'manualExit' handler it stops working. So this is some general issue with invocation framework.

Please use plain text.