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
Contributor
Posts: 25
Registered: ‎04-05-2012
My Device: Storm 9630
My Carrier: AT&T

Invoke and Close Browser from an application.

Hi,

 

I have created an application which required a facebook authencation for getting access authorized acess token.

For this i have invoked a browser field and m getting the acces token at one variable.

After this what i want is to close the browser screen and return back to my application. I have return one dismiss function under Browserscreen class to close Browseracreen to return back to my application.

 

protected void dismiss() {
        if (isDisplayed()) {
            synchronized (net.rim.device.api.system.Application.getEventLock()) {
                UiApplication.getUiApplication().popScreen(this);
            }
        }
    }

This function to close browser screen is not redirecting me to my application page instead of this I am redirecting to next FB screen as per Fb redirection.

 

Please help me that how can I close this Browser screen to return back to my application state.

 

Thanks.

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Invoke and Close Browser from an application.

you can use a browserfield for full control
----------------------------------------------------------
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
Contributor
Posts: 25
Registered: ‎04-05-2012
My Device: Storm 9630
My Carrier: AT&T

Re: Invoke and Close Browser from an application.

Thanks.

 

how can I used browserfiel.

 

I am taking some valuable information from Browserfield i have declared it as 

BrowserField bf = new BrowserField(BrowserFieldConfig bfc);

 

can this will help me by using:

 

protected void dismiss() {
        if (isDisplayed()) {
            synchronized (net.rim.device.api.system.Application.getEventLock()) {
                UiApplication.getUiApplication().popScreen(bf.getScreen());
            }
        }
    }

 

OR just

 

protected void dismiss() {
        if (bf.getScreen() != null) {
            synchronized (net.rim.device.api.system.Application.getEventLock()) {
                UiApplication.getUiApplication().popScreen(this);
            }
        }
    }

 

Or can you suggest some method.

 

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Invoke and Close Browser from an application.

a browser field is just a field on your screen, you can delete it.
----------------------------------------------------------
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
Contributor
Posts: 25
Registered: ‎04-05-2012
My Device: Storm 9630
My Carrier: AT&T

Re: Invoke and Close Browser from an application.

Hi,

I tried it ut doesn't work.

What I am doing to show the facebook login screen in browserfield is.

I am oushing a new screen named as LoginScreen and LoginScreen extends BrowserScreen which extends MainScreen.

I have created BrowserField in BrowserScreen class that means I am pushing one Screen to show facebook login page. And m fetching Access Token for user.

I have return dismiss function to close BrowserScreen to get back to my application page.But is not redirecting me to the application page,instead it leads me to next facebook page i.e. wall page on same BrowserScreen Screen.

 

I have mentioned the dissmiss function above which is not working to close the screen using popScreen.

Please help mt out in this.

 

Thanks.