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
Contributor
thorbjrn
Posts: 11
Registered: ‎09-28-2012
My Device: Playbook

App icon becomes transparent

Hi there!,

 

I have a problem developing a BlackBerry 10 app. I am using the Blackbery 10 Alpha Device.

 

When exiting my app (by swiping up from bottom of screen, and pressing close), the app-icon becomes transparent and I can't click it anymore. The only way to start the app again, is then by restarting the device.

 

What am I doing wrong?

 

 

Cheers,

Thorbjørn

 

Developer
mzex
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C

Re: App icon becomes transparent

[ Edited ]

App icon is transparent if your app is still running. You must have some bug in your destructor or similar. Check all code, which run when app should be  destroyed.

Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: App icon becomes transparent

To avoid having to restart the device, you can use Momentics to kill the process, or SSH in, use "pidin" to find the process id, and "slay" to issue a signal (SIGTERM etc) to kill it. The icon will "recover" at that point and you can restart the app.

That should help you troubleshoot the issue a bit faster. ;-)

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
yalnte
Posts: 44
Registered: ‎06-16-2012
My Device: BB10 Dev Alpha

Re: App icon becomes transparent

[ Edited ]

I'm also having this problem when closing via the navigator window. However, if I call exit(0) via a button in my app it closes graciously and the icon is opaque. This implies to me that my app isn't receiving the NAVIGATOR_EXIT signal correctly.

 

My app uses Qt/C++ so I tried reimplementing the closeEvent() function to simply call exit(0). However the transparent behaviour is the same.

 

Any ideas please?

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/
Contributor
thorbjrn
Posts: 11
Registered: ‎09-28-2012
My Device: Playbook

Re: App icon becomes transparent

Thanks for the answers!

 

I am also able to properly exit my app by calling "exit(0)".

The problem is that I don't know what is being run, when I exit by using the close button (seen by swiping up).

 

 

Cheers,

Thorbjørn

 

Developer
yalnte
Posts: 44
Registered: ‎06-16-2012
My Device: BB10 Dev Alpha

Re: App icon becomes transparent

I think this Qt/C++ BB10 example may hold some clues:

 

https://github.com/spstarr/qt-pictureflow-bb10/blob/master/pictureflow-qt/main.cpp

 

It connects the signals lastWindowClosed() and aboutToQuit() to the quit() slot:

 

  app->connect( app, SIGNAL(lastWindowClosed()), app, SLOT(quit()) );
  app->connect( app, SIGNAL(aboutToQuit()), app, SLOT(quit()) );

 I've tried adding this to my app, but it hasn't yet made a difference - I'm convinced this has something to do with it, so I'm going to try pursuing this route for now.

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/
Developer
yalnte
Posts: 44
Registered: ‎06-16-2012
My Device: BB10 Dev Alpha

Re: App icon becomes transparent

I seem to have worked around the issue by having these two statements as my first two lines of code:

int main(int argc, char **argv)
{
   QCoreApplication::addLibraryPath("app/native/lib");
   QApplication a(argc, argv);

// Attempt to stop app displaying in portrait mode    navigator_set_orientation_mode(NAVIGATOR_LANDSCAPE,NULL);
   navigator_rotation_lock(true); ... a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) ); a.connect( &a, SIGNAL(aboutToQuit()), &a, SLOT(quit()) );
return a.exec(); }

 Not sure if that's all necessary, but it seems to work for now. Only issue is that it now brings back the problem I had with the app displaying in portrait mode as described in the forum post here. But it's an improvement of sorts ...

 

 

 

 



 

----------------------------------------------------------------------------------
Blog: http://partialpivot.blogspot.co.uk/