title: How to remove packet listeners of XMPPClient using Smack
body: <p>I developed a chat app using <strong>Smack</strong> by <strong>XMPP server(openFire)</strong>. For getting incoming message, i used to <strong>PacketFilter</strong> 
  This is incoming msg code:-</p>
  
  <pre><code>PacketFilter filter = new MessageTypeFilter(Message.Type.chat);
          connection.addPacketListener(new PacketListener() {
              public void processPacket(Packet packet) {
                  Message message = (Message) packet;
                  incomemsg = message.getBody();
                  if (incomemsg != null) {
                      String fromName = StringUtils.parseBareAddress(message.getFrom());
                      frmname =  message.getBody();
                      Log.i("XMPPClient", "Got text [" + message.getBody() + "] from [" + fromName + "]");
                      // Add the incoming message to the list view
                      mHandler.post(new Runnable() {
                          public void run() {
                              // show the msg of chat in right side.
                                showMessage(frmname,false);
                                scrollContainer.getFocusables(scrollContainer.getChildCount());
                          }
                      });
  
                  }
              }
          }, filter);
  </code></pre>
  
  <p>But i want to remove paketListener during activity close or stop or destroy. i follow this <a href="http://community.igniterealtime.org/thread/28921" rel="nofollow">http://community.igniterealtime.org/thread/28921</a> for remove packet listeners
  But not found solution.</p>
  
  <p>please check. thank you for your timing.</p>