黑莓:获取未捕获的异常java.lang.securityexception

时间:2013-07-03 05:02:29

标签: blackberry java-me blackberry-eclipse-plugin

以下是SDcard

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){}
} 

当我运行此应用并向应用提供所有权限时,它会显示uncaught exception java.lang.securityexception。请有人帮我这个。

提前致谢..: - )

0 个答案:

没有答案