Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem is you are performing I/O operations on Application's event thread. When you use invokeLater( Runnable r ), r is executed on Application's event thread. In all probability, the Blackberry runtime would kill the application.</p> <p>As far as I see your code, you just don't have to create the anonymous inner class of Runnable that is passed to invokeLater(). You can simply do this:</p> <pre><code>if(connDesc != null) { System.out.println("Connection not null!"); httpConn = (HttpConnection) connDesc.getConnection(); try { httpConn.setRequestMethod(HttpConnection.GET); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } is = null; try { final int iResponseCode = httpConn.getResponseCode(); System.out.println("Connection in run!"); // Get InputConnection and read the server's response InputConnection inputConn = (InputConnection) httpConn; try { is = inputConn.openInputStream(); System.out.println("Connection got inputstream!"); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } byte[] data = null; try { data = IOUtilities.streamToBytes(is); System.out.println("Connection got data!"); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } EncodedImage hai = EncodedImage.createEncodedImage(data, 0, data.length); image = hai.getBitmap(); notifyUs(); catch(IOException e) { System.err.println("Caught IOException: " + e.getMessage()); } </code></pre> <p>Though, I find other issues with the code, it would be okay if you make the correction I mentioned.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload