public void reloadSessions(Activity fromActivity){
  ArrayList<MXSession> sessions=getMXSessions(fromActivity);
  for (  MXSession session : sessions) {
    CommonActivityUtils.logout(fromActivity,session,false);
  }
  clearSessions(fromActivity,false);
synchronized (LOG_TAG) {
    ArrayList<HomeserverConnectionConfig> configs=mLoginStorage.getCredentialsList();
    for (    HomeserverConnectionConfig config : configs) {
      MXSession session=createSession(config);
      mMXSessions.add(session);
    }
  }
  Intent intent=new Intent(fromActivity,SplashActivity.class);
  intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
  fromActivity.startActivity(intent);
  fromActivity.finish();
}

public void reloadSessions ( Activity fromActivity ) { ArrayList < MXSession > sessions = getMXSessions ( fromActivity ) ; for ( MXSession session : sessions ) { CommonActivityUtils . logout ( fromActivity , session , false ) ; } clearSessions ( fromActivity , false ) ; synchronized ( LOG_TAG ) { ArrayList < HomeserverConnectionConfig > configs = mLoginStorage . getCredentialsList ( ) ; for ( HomeserverConnectionConfig config : configs ) { MXSession session = createSession ( config ) ; mMXSessions . add ( session ) ; } } Intent intent = new Intent ( fromActivity , SplashActivity . class ) ; intent . setFlags ( Intent . FLAG_ACTIVITY_NEW_TASK | Intent . FLAG_ACTIVITY_CLEAR_TASK ) ; fromActivity . startActivity ( intent ) ; fromActivity . finish ( ) ; }
reload the matrix sessions . the session caches are cleared before being reloaded . any opened activity is closed and the application switches to the splash screen .
