Exemple #1
0
 @Override
 public void onAddEditCompleted(String city, String state, boolean home_boolean) {
   DatabaseDriver databaseDriver = new DatabaseDriver(this);
   databaseDriver.insertLocation(city, state, home_boolean);
   databaseDriver.close();
   weatherList.updateLocationList();
 }
 private void loadLocation() {
   DatabaseDriver databaseDriver = new DatabaseDriver(getActivity());
   Cursor cursor = databaseDriver.getLocation(rowID);
   cursor.moveToFirst();
   String entry =
       cursor.getString(cursor.getColumnIndex("city"))
           + ", "
           + cursor.getString(cursor.getColumnIndex("state"));
   cursor.close();
   databaseDriver.close();
   new FetchWeatherTask().execute(entry);
 }
 private void maybeGetDriverClassName() {
   if (!this.properties.containsKey("driverClassName") && this.properties.containsKey("url")) {
     String url = this.properties.get("url");
     String driverClass = DatabaseDriver.fromJdbcUrl(url).getDriverClassName();
     this.properties.put("driverClassName", driverClass);
   }
 }
 private void deleteLocation() {
   DatabaseDriver databaseDriver = new DatabaseDriver(getActivity());
   databaseDriver.deleteLocation(rowID);
   databaseDriver.close();
 }