@Override
  public void onCreate() {
    super.onCreate();

    String storageDir = getApplicationContext().getFilesDir().getAbsolutePath() + "/";
    String storageFile = storageDir + "storage.dat";
    String storageJournal = storageDir + "journal.dat";
    EncryptedStorage storageCrypto =
        new EncryptedStorage(storageFile, storageJournal, new CryptoKey(new byte[16]));
    storageCrypto.close();
  }
예제 #2
0
        public void onActionBarItemClicked(int position) {
          if (position == OnActionBarListener.HOME_ITEM) {

            final GDApplication app = getGDApplication();
            switch (mActionBarType) {
              case Normal:
                final Class<?> klass = app.getHomeActivityClass();
                if (klass != null && !klass.equals(GDMapActivity.this.getClass())) {
                  if (Config.GD_INFO_LOGS_ENABLED) {
                    Log.i(LOG_TAG, "Going back to the home activity");
                  }
                  Intent homeIntent = new Intent(GDMapActivity.this, klass);
                  homeIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                  startActivity(homeIntent);
                }
                break;
              case Dashboard:
                final Intent appIntent = app.getMainApplicationIntent();
                if (appIntent != null) {
                  if (Config.GD_INFO_LOGS_ENABLED) {
                    Log.i(LOG_TAG, "Launching the main application Intent");
                  }
                  startActivity(appIntent);
                }
                break;
            }

          } else {
            if (!onHandleActionBarItemClick(getActionBar().getItem(position), position)) {
              if (Config.GD_WARNING_LOGS_ENABLED) {
                Log.w(
                    LOG_TAG,
                    "Click on item at position " + position + " dropped down to the floor");
              }
            }
          }
        }