/** Fragment interface implementation. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    moduleManager = appSession.getModuleManager();
    errorManager = appSession.getErrorManager();
    toolbar = getToolbar();
    moduleManager.setAppPublicKey(appSession.getAppPublicKey());
    loadSelectedActorIdentityInBackground();

    loadSettings();

    // Check if a default identity is configured
    try {
      identity = moduleManager.getSelectedActorIdentity();
      if (identity == null) {
        List<CryptoCustomerCommunitySelectableIdentity> identities =
            moduleManager.listSelectableIdentities();
        if (identities.isEmpty())
          launchActorCreationDialog = true; // There are no identities in device
        else launchListIdentitiesDialog = true; // There are identities in device, but none selected
      }

    } catch (CantGetSelectedActorIdentityException
        | ActorIdentityNotSelectedException
        | CantListIdentitiesToSelectException e) {
      errorManager.reportUnexpectedSubAppException(
          SubApps.CBP_CRYPTO_CUSTOMER_COMMUNITY,
          UnexpectedSubAppExceptionSeverity.DISABLES_SOME_FUNCTIONALITY_WITHIN_THIS_FRAGMENT,
          e);
    }
  }
  @Override
  public List<CryptoCustomerCommunityInformation> getMoreDataAsync(
      FermatRefreshTypes refreshType, int pos) {
    List<CryptoCustomerCommunityInformation> dataSet = new ArrayList<>();

    try {
      offset = pos;
      List<CryptoCustomerCommunityInformation> result =
          moduleManager.listWorldCryptoCustomers(
              moduleManager.getSelectedActorIdentity(), location, distance, alias, MAX, offset);
      dataSet.addAll(result);
    } catch (Exception e) {
      e.printStackTrace();
    }

    return dataSet;
  }
  private void loadSettings() {
    try {
      appSettings = this.moduleManager.loadAndGetSettings(appSession.getAppPublicKey());
    } catch (Exception e) {
      appSettings = null;
    }

    if (appSettings == null) {
      appSettings = new CryptoCustomerCommunitySettings();
      appSettings.setIsPresentationHelpEnabled(true);
      try {
        moduleManager.persistSettings(appSession.getAppPublicKey(), appSettings);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }