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

Java Development

Reply
Developer
Posts: 40
Registered: ‎06-04-2014
My Device: Bold 9900
Accepted Solution

Camera page appears white after first use

Hello everyone,

 

I'm having an issue with getting a QR scanner working correctly. The strange part is that after I scan once, the camera view finder no longer appears on the screen.

 

Here's the page flow I currently have:

When the user first opens the app...

1. Splash Screen

2. Splash screen automatically opens the landing page screen where the user is presented with buttons.

3. User selects that they would like to use the QR scanner

4. QR scanner page opens, camera turns on and is shown on BB screen.

5. QR code is scanned decoded, and a results page is shown. (QR Page is popped from the stack immediately before the Results page is pushed)

6. User presses back and returns to the landing page

7. User selects QR button again

8. User sees a white screen, but the camera light turns on.

 

I will have to clean up the code before I post it. I've been using the BarcodeScanDemo example in the BB JDK

Developer
Posts: 16,495
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Camera page appears white after first use

add logging and check what screens are on the screen stack.

a first guess would be that you push a screen above the camera.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 40
Registered: ‎06-04-2014
My Device: Bold 9900

Re: Camera page appears white after first use

Do you know of a way to hook into the push and popScreen methods so I can log them whenever they're called?

Developer
Posts: 40
Registered: ‎06-04-2014
My Device: Bold 9900

Re: Camera page appears white after first use

I think I figured this out.

 

I was expecting that the QRPage would be pushed first when I ran this code:

 

UiApplication.getUiApplication().pushScreen(new QRPage());

 

But really what was happening was that inside QRPage I was also calling the pushScreen method. Those screens were getting pushed first, and the when the call to new QRPage() finally returned, it was pushed on top of all the other screens.