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: 122
Registered: ‎09-15-2010
My Device: BB - 9800
Accepted Solution

Unable to Pop ZoomScreen...........

Hi All,

 

                 The  code  below is  used  to pop the ZoomScreen, but I'm unable to pop the 

 

ZoomScreen.  I tried both popScreen(zoomScreen) and zoomScreen.close() where zoomScreen is 

 

the ZoomScreen class object.  But I'm unable to Pop the Screen.

 

Is this the write way to pop the ZoomScreen?????? 

 

Any help in this regards would be highly appreciated.................

 

 

 

EncodedImage myImg = EncodedImage.createEncodedImage(data, 0, data.length);
zoomingScreen = new ZoomScreen(myImg);
UiApplication.getUiApplication().pushScreen(zoomingScreen);
zoomingScreen.addKeyListener(new MyKeyListener());
}
	private class MyKeyListener implements KeyListener 
	{
	public boolean keyDown(int keycode, int time) {
		int key = Keypad.key(keycode);
		if (key == Keypad.KEY_ESCAPE) 
		{
			//Dialog.alert("***********");
			UiApplication.getUiApplication().popScreen(zoomingScreen);
			//zoomingScreen.close();
			
			return true;
		}
		// Otherwise, we'll return false so as not to consume the
		// keyDown event
		return false;
	}
	// We will only act on the keyDown event
	public boolean keyChar(char key, int status, int time) {
		return false;
	}

	public boolean keyRepeat(int keycode, int time) {
		return false;
	}

	public boolean keyStatus(int keycode, int time) {
		return false;
	}

	public boolean keyUp(int keycode, int time) {
		return false;
	}
}

 

 

regards,

Saran.....

 

Developer
Posts: 122
Registered: ‎09-15-2010
My Device: BB - 9800

Re: Unable to Pop ZoomScreen...........

Any help please.............

Contributor
Posts: 12
Registered: ‎10-29-2010
My Device: Not Specified

Re: Unable to Pop ZoomScreen...........

Somewhat like this might help Smiley Happy

 

public class ImageViewerSubZoomScreen extends ZoomScreen {
    
    public ImageViewerSubZoomScreen(EncodedImage image) {
        super(image);
    }
    
    protected boolean keyChar(char c, int status, int time) {
        if(c == Characters.ESCAPE){
            return false;
        }else{
            return super.keyChar(c, status, time);
        }
    }
    
}

Developer
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: Unable to Pop ZoomScreen...........

I guess your zoom screen is at the top of the screen

 

try with this in your Escape event handling

 

 

	UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication().getActiveScreen());

 

 

Thanks and Regards,
PraveenGoparaju.
Contributor
Posts: 12
Registered: ‎10-29-2010
My Device: Not Specified

Re: Unable to Pop ZoomScreen...........

btw Is there any way to find out the zoom level or the visible region's offset coordinates in the ZoomScreen ?

Developer
Posts: 122
Registered: ‎09-15-2010
My Device: BB - 9800

Re: Unable to Pop ZoomScreen...........

thanks both of u guys, its working now........................,Smiley Very Happy