2
       public void onClick(View button_one) 
           {
              new Thread(new Runnable() 
                 {
                    public void run() 
                       {
                          final SoapObject request;
                          request.post(new Runnable() // THIS post over HERE !!!
                             {
                                public void run() 
                                   {
                                      request = new SoapObject(NAMESPACE, METHOD_NAME);
                                   }
                             });
                       }
                }).start();
           }

问题:帖子带有下划线,eclipse的解决方案如下,但这会产生大量新问题

-The method post(new Runnable(){}) is undefined for the type SoapObject

另外,这会成功运行吗?还是我做错了什么????

4

1 回答 1

0

错误消息很清楚:您的request变量没有post()方法。看起来您正在尝试使用View.post(),它在 UI 线程上运行代码。这不是必需的,只需像这样创建您的对象:

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
于 2012-10-24T12:11:57.347 回答