title: Android SQLite query: "queryNumEntries .. is not applicable for the arguments"?
body: <p>I have a database named <code>contacts.db</code> with a table named <code>TABLE_NAME</code> that has one column named <code>Contactname</code>. I want to format a query to check if a contact name that I have as a value in the String variable name is already saved as a record in the table and if it isn't then I want to add it, or else do nothing. The code that I wrote is as follows:</p>
  
  <pre><code>SQLiteDatabase db = events.getReadableDatabase();
  int rawNum = DatabaseUtils.queryNumEntries(db, TABLE_NAME, 
                          "Contactname=?", new String[] {contactName}); 
      if(rawNum==0){
          addRecord(contactName);
          addedCounter+=1;
      }
      else{
          savedCounter+=1;
      }
  </code></pre>
  
  <p>But the app is forced to close. Can you see anything wrong with the query? What I do is to see whether there are any rows and if the number of rows is 0 then to add the contact.</p>