문제

I want to have a http connection in my J2ME application using Lwuit which will have a timeout, can manually stop the request with a button, and a loading dialog while it is processing. I tried thread for HTTP connection but even when I try to interrupt the thread, the connection is still running.Can anyone help me with a example ?

도움이 되었습니까?

해결책

There is no way to stop an HTTP connection in MIDP. LWUIT4IO provides an API to kill a connection via the kill method which effectively just discards the thread and closes the IO streams it is using. There is a timeout flag in MIDP but it doesn't always work and there is no indication of when the timeout should elapse.

See LWUIT's see this, I don't have a sample of killing but there are several samples of using LWUIT4IO.

다른 팁

What about the STOP Command variable ? Look at the Javadoc about it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top