我想从J2ME midlet中调用一个Servlet,所以我编写了Servlet URL的HTTPConnection代码来调用GET方法。为什么J2ME Midlet Suite和HTTPConnection需要使用不同的线程
当MIDlet套件试图连接到服务器URL,我已经得到了在模拟器中下面的消息,
{#MyMidlet} Midlet Suite wants to connect to {#Servlet URL} using air time,
this may result in charges, Is it ok to use airtime ?
如果我点击有或无,什么都没有发生,它刚刚绞死,我使用EclipseME和SUN WTK 2.5.2。并在控制台中出现警告,
Warning: To avoid potential deadlock, operations that may block, such as
networking, should be performed in a different thread than the
commandAction() handler.
这意味着,如果我做一个单独的线程中为HttpConnection,将问题解决呢?
试试看! – funkybro 2012-07-26 07:27:49
它的工作,当我改变HttpConnection在不同的线程。谢谢 !! – Murugesh 2012-07-26 13:47:40
没问题!虽然下次我只是自己尝试一下,而不必在这里发布问题......节省了很多时间! – funkybro 2012-07-26 14:10:55