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: 298
Registered: ‎05-02-2010
My Device: Bold 9700
My Carrier: Verizon

OS 6: Registry.getRegistry parameter question.

[ Edited ]

I have the following:

 

protected boolean navigationClick(int arg0, int arg1) {
  final String url = "http://[...].3gp";
  Runnable r = new Runnable() {
    public void run() {
      try {
        Invocation media = new Invocation(url);
        media.setResponseRequired(false);
        media.setID(BlackBerryContentHandler.ID_MEDIA_CONTENT_HANDLER);
        Registry rg = Registry.getRegistry("net.rim.device.api.content.BlackBerryContentHandler");
        rg.invoke(media);
      } catch (IOException e) {
        Logger.logEventError("[CVideo] IO: " + e.getMessage());
      } catch (Exception e) {
        Logger.logEventError("[CVideo]" + e.getMessage());
      }
    }
  };
  new Thread(r, "Event").start();

  return true;
}

 

As I understand the following, the classname parameter must be the name of a registered application class or a registered content handler.

 

So I assume either of these work:

 

  • Registry rg = Registry.getRegistry("net.rim.device.api.content.BlackBerryContentHandler");
  • Registry rg = Registry.getRegistry(Application.getApplication().getClass().getName());

However, nothing happens on the Torch device or simulator. The media player doesn't start and there isn't any noticable activity.

 

Reading the KB article and a few other threads, I think this is correct?

 

Any help is appreciated.

 

Well only the second Registry statement works... But still no luck.

 

 

 

--Todd

Windows 7 Enterprise 64-bit (6.1 Build 7600) | Java SE Runtime Environment (build 1.6.0_24-b07) | Eclipse Version: 3.6.2 [M20110210-1200] | BlackBerry Eclipse Plug-in: 1.3.0.201102031007-19 | Java Compiler level: 1.3 | Targeting devices running OS 5 | Simulators: JDE 5.0 packaged 9700, 9630, 9300
Contributor
Posts: 13
Registered: ‎07-27-2011
My Device: blackberry 9000
My Carrier: Idea

Re: OS 6: Registry.getRegistry parameter question.

Hi,

Could you please let us know if your second option worked.If the problem is solved please mark it as solved.