以下是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
。请有人帮我这个。
提前致谢..: - )