public synchronized void clearSessions(Context context,Boolean clearCredentials){
synchronized (instance) {
    while (mMXSessions.size() > 0) {
      clearSession(context,mMXSessions.get(0),clearCredentials);
    }
  }
}

public synchronized void clearSessions ( Context context , Boolean clearCredentials ) { synchronized ( instance ) { while ( mMXSessions . size ( ) > 0 ) { clearSession ( context , mMXSessions . get ( 0 ) , clearCredentials ) ; } } }
clear any existing session .
