在asmack android中阻止用户

时间:2014-12-12 05:33:47

标签: android asmack

我无法阻止用户,下面是我正在使用的代码

List<PrivacyItem> privacyItems = new Vector<PrivacyItem>();
                    PrivacyItem item = new PrivacyItem(PrivacyItem.Type.jid.toString(), false, 2);

                item.setFilterIQ(true);
                item.setFilterMessage(true);
                item.setFilterPresence_in(true);
                item.setFilterPresence_out(true);

                item.setValue(friendName);
                item.setOrder(23);

                privacyItems.add(item);
                PrivacyListManager privacyManager = PrivacyListManager.getInstanceFor(connection);
                String privacyListName = MailManager.getAddress();
                try {
                    //privacyManager.updatePrivacyList(friendName, privacyItems);
                    privacyManager.createPrivacyList(friendName, privacyItems);
                } catch (Throwable e) {
                }

0 个答案:

没有答案