Asmack在创建隐私列表时获取NullPointerExeption

时间:2014-02-10 04:32:15

标签: android xmpp ejabberd smack asmack

我尝试创建/检索隐私列表但我得到NullPointerException。我正在使用ejabberd xmpp服务器。

这里是我的代码。

String listName = "newList";

            // Create the list of PrivacyItem that will allow or deny some privacy aspect
            String user = "tybalt@example.com";
            String groupName = "enemies";
            ArrayList privacyItems = new ArrayList();

            PrivacyItem item = new PrivacyItem(PrivacyItem.Type.jid.toString(), true, 1);
            item.setValue(user);
            privacyItems.add(item);


            // Get the privacy manager for the current connection.
            PrivacyListManager privacyManager = PrivacyListManager.getInstanceFor(connection);
            // Create the new list.

            privacyManager.createPrivacyList(listName, privacyItems);

0 个答案:

没有答案