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
New Developer
CBLotsToLearn
Posts: 6
Registered: ‎10-29-2008
My Device: 8830 (Sprint) v4.2.2.196

Browser displayPage doesn't show page until I click menu key

I have a very simple midlet I created just to launch

the BlackBerry browser to a specific web page.  It basically works except for one major flaw: the display just sits at the BlackBerry browser logo screen unless I click on the menu key.  Once I do, the page that was launch can be seen underneath the menu.  Can anyone tell me what I might be missing or doing wrong in the code below?

 

By the way this app is loaded via .alx onto a BlackBerry 8830 World Edition (Sprint) with v4.2.2.196 (Platform 3.0.0.85) using JDE version 4.2.1.41.

 

Here is the entire code:

****************************************

package com.mycompany.myprojects.MyApp;

import javax.microedition.midlet.*;
import net.rim.blackberry.api.browser.*;

public class MyApp extends MIDlet
{

    public void startApp()
    {
        BrowserSession bs = Browser.getDefaultSession();
        bs.displayPage("http://www.asitename.com/adir/asubdir/adotnetpage.aspx");
        bs.showBrowser();
        destroyApp(false);
        notifyDestroyed();
    }

    public void destroyApp(boolean unconditional)
    {
    }

    public void pauseApp()
    {
    }

}

****************************************

 

Any help is greatly appreciated, thanks.

 

BlackBerry Development Advisor
MSohm
Posts: 14,757
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: Browser displayPage doesn't show page until I click menu key

I tried the exact same code you have above on the same BlackBerry model and handheld software version and was not able to reproduce this behaviour.  In my tests the page loaded correctly without pressing any additional keys.  Is there anything else your application is doing?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
CBLotsToLearn
Posts: 6
Registered: ‎10-29-2008
My Device: 8830 (Sprint) v4.2.2.196

Re: Browser displayPage doesn't show page until I click menu key

Thank you for trying it out.  I have gotten it to work as well now, first by editing the permissions and setting each of the three different permission sets to "Allow".  Second, I purposely decided to erase all application data on the device and basically started over again with the device.  Guess what?  Even though the permission sets were now Custom, Custom, Allow (in order), the app worked ok!  So, I'm really confused as to why it wasn't working right in the first place, but it does seem to work ok now.  I wonder if other installed applications I had on there such as CNN, PocketExpress, or even MonkeyMadness, may have somehow changed settings or something and thus caused a problem.  Anyway, thanks very much again.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Browser displayPage doesn't show page until I click menu key

Did it work twice? We saw this problem on second hit on some platforms. It seems

to be due to having a uiapplication which the midlet presumably does more covertly.

 

If it works twice, then it is a different problem.

 

New Developer
CBLotsToLearn
Posts: 6
Registered: ‎10-29-2008
My Device: 8830 (Sprint) v4.2.2.196

Re: Browser displayPage doesn't show page until I click menu key

As best I can remember it did work at least twice once I got it working, yes.  Unfortunately I can not test it out again for some time as the project I was doing it for has been put on hold for now and I don't even have the phone to test on anymore.