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: 105
Registered: ‎07-24-2008
My Device: Not Specified

Native BB screen vs Blackberry Java App screen

Hi All,

 

   How to know programatically, if the screen in the foreground is a native Blckberry screen ( example - Blackberry camera preview screen) or Blackberry application screen?

 

UiApplication.getUiApplication().getActiveScreen()

 This method returns the applicaiton screen top in stack even though some native BB app screen is on top.

 

 

regards,

Abhijit Chandekar

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Native BB screen vs Blackberry Java App screen

The method is performing correctly.

 

You can check if your application is in being displayed by seeing if your application is in the foreground. 

<application>.isForeground()

Developer
Posts: 105
Registered: ‎07-24-2008
My Device: Not Specified

Re: Native BB screen vs Blackberry Java App screen

Thanks Peter,I agree that the method is performing correct.It was just an example of wht i tried

 

1) My app starts

2) on menu button click i invoke BB camera.

3) takes a picture.( I have a FileSystemJournalListener implemented)

4) I save the picture in req place

5) If the user has set the camera image preview option ON, the preview screen comes up

     This preview screen should NOT be displayed as per the app requirement.

 

How do i programatically know if the screen which is displayed on the top is preview screen.So that, i can inject a back press and remove the screen as soon as its displayed.

 

regards,

Abhijit Chandekar

Developer
Posts: 105
Registered: ‎07-24-2008
My Device: Not Specified

Re: Native BB screen vs Blackberry Java App screen

I observed from the debug history that, the preview screen is a UI component called as "CameraPreveiewScreen"

 

"[0.0] FocusHistory: Focus lost; App net_rim_bb_camera; Component net.rim.device.apps.internal.camera.Camer[0.0] aPreviewScreen"

 

Want to programatically check if its this screen on the top.If it is i can inject escape.

 

Developer
Posts: 105
Registered: ‎07-24-2008
My Device: Not Specified

Re: Native BB screen vs Blackberry Java App screen

You can check if your application is in being displayed by seeing if your application is in the foreground. 

<application>.isForeground()

 

This will always return camera app.But my app is interested in knowing the preview screen of the camera app.