title: Offline Message using smack in android
body: <p>I can able to create small chat application using smack api.how ever ,i am unable to receive offline messages by using <strong>offlineMessageManager</strong> class in smack api.It just throws a <strong>nullpointerexception</strong> when i supposed to call method getMessageCount in the first line of code that i pasted here.</p>
  
  <pre><code>            DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(null,namespace);
              Form extendedInfo = Form.getFormFrom(info);
              if (extendedInfo != null) {
                  String value = extendedInfo.getField("number_of_messages").getValues().next();
                  return Integer.parseInt(value);
              }
              }
  
              return 0;
  </code></pre>