Hi guys.the provider executing the listener does not work.
Register listeners;
mGetListenPackets(xmppconn,new PacketTypeFilter(IQ.class));
mGetListenPackets(xmppconn,new PacketTypeFilter(Presence.class));
mGetListenPackets(xmppconn,new PacketTypeFilter(org.jivesoftware.smack.packet.Message.class));
ProviderManager.getInstance().addIQProvider(Ping.ELEMENT, Ping.NAMESPACE, new PingProvider());
ProviderManager.getInstance().addIQProvider(Provider.element_name, Provider.namespace,new Provider());
i catch custom iq packets but listener does not work.
@Overridepublic IQ parseIQ(XmlPullParser xpp) throws Exception { int eventType = xpp.getEventType(); PvCommand pvCommand = null; String currentTag = null; while (eventType != XmlPullParser.END_DOCUMENT) { if (eventType == XmlPullParser.START_TAG) { currentTag = xpp.getName(); if (xpp.getName().equalsIgnoreCase("pvcommand")) { pvCommand = new PvCommand(); } }elseif (eventType == XmlPullParser.END_TAG) { currentTag = null; if (xpp.getName().equalsIgnoreCase("pvcommand")) { // custom iq send dispatcher method iqPacketDispatcher(pvCommand); pvCommand = null; } }elseif (eventType == XmlPullParser.TEXT) { if (currentTag != null) { if (currentTag.equalsIgnoreCase("sendClassName")) { pvCommand.setSendClassName(xpp.getText()); }elseif (currentTag.equalsIgnoreCase("sendMethodName")) { pvCommand.setSendMethodName(xpp.getText()); }elseif (currentTag.equalsIgnoreCase("spvcommand")) { pvCommand.setSpvCommand(xpp.getText()); } } } eventType = xpp.next(); } returnnull; }
i add break in provider.listener worked.but server send error packet.
help me please.