Ejemplo n.º 1
0
 private void initPingListener() {
   ChatPingAlarmManager.onCreate(this);
   ChatPingAlarmManager.getInstanceFor()
       .addPingListener(
           new PingFailedListener() {
             @Override
             public void pingFailed() {
               showToast("Ping chat server failed");
             }
           });
 }
Ejemplo n.º 2
0
  private void logoutSession() {
    try {
      DataHolder.setLoggedUser(null);
      QBRTCClient.getInstance(this).destroy();

      // comment if you haven't started ping alarm
      ChatPingAlarmManager.onDestroy();
      QBChatService.getInstance().logout();
    } catch (SmackException.NotConnectedException e) {
      e.printStackTrace();
    }
  }