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: 55
Registered: ‎09-09-2008
My Device: Not Specified

Knowledge Base : Invoke default Browser (for 4.2.2 and later) throw ControlledAccessException

1.     I hope to launch browser in my application. I use the same code as invoke the default browser.

 

boolean retval = true;

int handle = CodeModuleManager.getModuleHandle("net_rim_bb_browser_daemon");

if (handle <=0 ) {
     retval = false;
}
else {
     ApplicationDescriptor[] browserDescriptors = CodeModuleManager.getApplicationDescriptors(handle);

     if (browserDescriptors == null ) {
          retval = false;
     }
     else
     {
          if ( browserDescriptors.length <=0 ) {
               retval = false;
          } else {
               String[] args = {"url", "http://URL2LAUNCH.COM"};

               ApplicationDescriptor descriptor = new ApplicationDescriptor
               (
                    browserDescriptors[0],
                    "url invocation", args,
                    null, -1, null, -1,
                    ApplicationDescriptor.FLAG_SYSTEM
               );

               try
               {
                    ApplicationManager.
                    getApplicationManager().
                    runApplication(descriptor);
               }
               catch(ApplicationManagerException e)
               {
                    retval = false;
               }
          }
     }
}

 

       

    On the simulator it works well, but on device (OS 4.2.2) it throws exception:

ControlledAccessException:

 net_rim_cldc

 ControlledAccess

 assertRISignature

 0*3413

 

  Any idea about this? 

 

2.   when we call Browser.getdefaultSession(),  this defaultSession might have previous page, I mean if user hasn't click close menu from Browser, all the pages that user has checked will still be in this defaultSession. Is there any way to clean browser's default session or create a new browser session to avoid this?

 

Thanks.

 

 

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Knowledge Base : Invoke default Browser (for 4.2.2 and later) throw ControlledAccessException

Go to Options / Security Options / Applications / (your application)

 

...and make sure all three sections are set to "Allow" on your device.

New Developer
Posts: 22
Registered: ‎07-17-2008
My Device: Not Specified

Re: Knowledge Base : Invoke default Browser (for 4.2.2 and later) throw ControlledAccessException

That is no longer an approved way of launching the browser (I found out the hard way...).  RIM really should be proactive in removing the old scheme from articles and such.  It is easy to stumble on the now unsupported way.

 

See this article.  http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800440/How_To_...

 

 

Highlighted
Developer
Posts: 55
Registered: ‎09-09-2008
My Device: Not Specified

Re: Knowledge Base : Invoke default Browser (for 4.2.2 and later) throw ControlledAccessException

Thanks Lanceo. If I used broswer.getdefaultSession().displayPage(url) ,  it is very annoying because it will come with its previous pages.

 

Any solutions?