0
嗯,我已經使用LWUI ImageDownloadService從網絡下載圖像。當下載進度時,進度對話框顯示。我想通過按取消命令停止下載。但它仍在下載。我能做些什麼來阻止下載?LWUIT無法終止連接請求
我的代碼如下
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);
NetworkManager.getInstance().addToQueue(img);
resultForm.addComponent(mLabel);
Progress progress = new Progress("Loading", img);
progress.setDisposeOnCompletion(true);
progress.show();
}
我已經上傳圖片here
可能重複的[Lwuit網絡連接超時問題](http://stackoverflow.com/questions/17416994/lwuit-network-connection-timeout-issue) –
無法設置超時,無法停止連接? –
看看這個參考。這是我的答案http://stackoverflow.com/questions/13966033/how-to-handle-network-thread-calls-and-wait-progress-in-j2me/13969115#13969115 – neb1