title: How to open a file with JSR 211 CHAPI (Content Handler API)
body: <p>Please note that this is a question about MIDlets, i.e. Java ME (not "ordinary" Java SE).</p>
  
  <p>I'm looking for the correct way to invoke content on a mobile phone using JSR 211, i.e. CHAPI - Content Handler API. I always get to the IOException in the code below. The mobile phone I'm running on supports JSR 211 (it's a Sony Ericsson C902).</p>
  
  <pre><code>doInvoke("file:///e:/jpgimage.jpg"); //earlier in the code
  
  void doInvoke(final String url) {
      (new Thread() {
          public void run() {
              try {
                  Registry registry = Registry.getRegistry(this.getClass().getName());
                  Invocation invoc = new Invocation(url);
                  invoc.setAction(ContentHandler.ACTION_OPEN);
                  boolean mustExit = registry.invoke(invoc);
                  if (mustExit) {
                      notifyDestroyed();
                  } else {
                      // stay put
                  }
              } catch (IOException ex) {
                  ex.printStackTrace();
              }
          }
      }).start();
  }
  </code></pre>