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