title: Android database not updating
body: <p>This method is supposed to update the friend in the database. But it is not. No error is shown, tried restarting to refresh the list etc still nothing. Log is showing me new values but they are not saved in the database.</p>
  
  <pre><code>public void updateFriend(Friend friend) {
      Log.d("UpdateFriendMethod", friend.toString());
      SQLiteDatabase db = this.getWritableDatabase();
      ContentValues values = new ContentValues();
      values.put(KEY_NAME, friend.getName()); 
      values.put(KEY_BIRTHDAY, friend.getBirthday().getTimeInMillis());
      db.update(TABLE_Friends,
              values, 
              KEY_NAME + " = ?", 
              new String[] { String.valueOf(friend.getName()) });
  
      db.close();
  }
  </code></pre>
  
  <p>Here is the way how do I get items from db:</p>
  
  <pre><code>public List&lt;Friend&gt; getAllFriends() {
      List&lt;Friend&gt; Friends = new LinkedList&lt;Friend&gt;();
      String query = "SELECT  * FROM " + TABLE_Friends;
      SQLiteDatabase db = this.getWritableDatabase();
      Cursor cursor = db.rawQuery(query, null);
      if (cursor.moveToFirst()) {
          do {
              Friend friend = new Friend();
              friend.setName(cursor.getString(0));
              Date date = new Date(cursor.getLong(1));
              GregorianCalendar cal = new GregorianCalendar();
              cal.setTime(date);
              friend.setBirthday(cal);
              Friends.add(friend);
          } while (cursor.moveToNext());
      }
  
      Log.d("getAllFriends()", Friends.toString());
      return Friends;
  }
  </code></pre>
  
  <p>I bet, problem is somewhere in that SQL statement, I am not familiar with it yet, I am used to SQL language not this. </p>