抱歉我的英语不好。
我已从网络下载图像,我设置超时2000毫秒,但超时不起作用。 这是我的代码
public void actionPerformed(ActionEvent evt) {
if (evt.getSource() == okCommand) {
final Form resultForm = new Form("Result");
resultForm.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
resultForm.show();
Label mLabel = new Label();
ImageDownloadService img = new ImageDownloadService("http://datastore04.rediff.com/h1500-w1500/thumb/69586A645B6D2A2E3131/s47kscdm7r4pjx05.D.0.Happy-Valentines-Day-Wallpaper-Image.jpg", mLabel);
img.setTimeout(2000);
NetworkManager.getInstance().addToQueue(img);
resultForm.addComponent(mLabel);
Progress progress = new Progress("Loading", img);
progress.setDisposeOnCompletion(true);
progress.show();
}
答案 0 :(得分:0)
我们在LWUIT上使用超时时遇到了一些问题。它应该与Codename One一起工作,尽管在J2ME上它会被“伪造”,因为J2ME不允许超时,所以我们基本上杀了整个线程。