aSmack,使用UserSearchManager为Search发送List <string>会返回IllegalStateException </string>

时间:2014-09-06 14:01:10

标签: android asmack

我正在尝试将用于搜索的电子邮件列表发送到服务器:

   List<String> mails = new ArrayList<String>();
   mails.add("myMail");
   UserSearchManager usm = new UserSearchManager(connection);
      Form searchForm = usm.getSearchForm("search.reza-hp");
      Form answerForm = searchForm.createAnswerForm();
      answerForm.setAnswer("Email", true);
      answerForm.setAnswer("search",phoneContacts);
      ReportedData data = usm.getSearchResults(answerForm, "search.reza-hp");

但是我得到了这个例外&gt; IllegalArgumentException:此字段仅接受值列表

任何想法我应该如何准备要发送的列表?

logcat的:

  09-06 12:47:07.750: E/AndroidRuntime(9769): java.lang.IllegalArgumentException: This 
field only accept list of values.
09-06 12:47:07.750: E/AndroidRuntime(9769):     at 
org.jivesoftware.smackx.xdata.Form.setAnswer(Form.java:314)
09-06 12:47:07.750: E/AndroidRuntime(9769):     at     
com.lifemate.lmmessenger.listviewengine.ListViewActivity.
getPhoneContacts(ListViewActivity.    java:879)
09-06 12:47:07.750: E/AndroidRuntime(9769):     at  
com.lifemate.lmmessenger.listviewengine.ListViewActivity.
onViewCreated(ListViewActivity.jav
a:209)
09-06 12:47:07.750: E/AndroidRuntime(9769):     at 
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:956)
09-06 12:47:07.750: E/AndroidRuntime(9769):     at 
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1121)
09-06 12:47:07.750: E/AndroidRuntime(9769):     at 
android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
09-06 12:47:07.750: E/AndroidRuntime(9769):     at   
android.support.v4.app.FragmentManagerImpl.execPendingActions
(FragmentManager.java:1484)

0 个答案:

没有答案