Blackberry: Getting uncaught exception java.lang.securityexception

Posted by Maxim Xion on Stack Overflow See other posts from Stack Overflow or by Maxim Xion
Published on 2013-07-03T05:02:29Z Indexed on 2013/07/03 5:05 UTC
Read the original article Hit count: 186

here is my code to open an image file from SDcard in Blackberry

import javax.microedition.midlet.*;

import javax.microedition.lcdui.*;

import java.io.*;

public class DisplayAnImage extends MIDlet

{

private Display mDisplay;

private Form mForm;

private Image pngBackground;



public void startApp()

{

    try{

        pngBackground = Image.createImage("file:///Media Card/test_image.png");

        ImageItem img = new ImageItem("bg",pngBackground,

        ImageItem.LAYOUT_EXPAND,"background",ImageItem.PLAIN);



        mForm = new Form("MIDlet Developer Guide: Display an image."); 

        mForm.append(img);



        mDisplay = Display.getDisplay(this);

        mDisplay.setCurrent(mForm); 

    } 

    catch(IOException e)

    {

        mForm.append(e.getMessage());

    }

}



public void pauseApp()

{

}



public void destroyApp(boolean flag)

{

}

}

While I am running this app with giving all permission to app it shows me "uncaught exception java.lang.securityexception". Please somebody help me on this.

Thanks in advance.. :-)

© Stack Overflow or respective owner

Related posts about blackberry

Related posts about blackberry-eclipse-plugin