Ejemplo n.º 1
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // get handle to the application preferences
    prefs = new Preferences(context);

    // get the most recently selected option from the 'App Type' list, and set as current
    currentAppType = prefs.getLastAppListType();

    /*
     * If the database version has changed, we will need to rebuild the application cache
     */
    if (prefs.getLastRunDatabaseVersion() != DBInterface.DBHelper.DATABASE_VERSION) {
      Log.d(
          "PDroidAlternative",
          "Defined database version has changed since last run; we need to rebuild the cache");
      // this will force the application list to be rebuilt from the application package manager
      prefs.setIsApplicationListCacheValid(false);
      prefs.setLastRunDatabaseVersion(DBInterface.DBHelper.DATABASE_VERSION);
    }

    setHasOptionsMenu(true);
  }