title: cursor count always returns 0 in sqlitedatabase android
body: <p>I have simple method which checks for existing username in sqlitedatabase. if it exists it return true else false.</p>
  
  <p>but cursor.getcount() always return 0, no matter how i change the query.</p>
  
  <p>here is my code:</p>
  
  <pre><code>public boolean IsUsernameexists(String username)
      {
          boolean b=false;
          int count=0;
  
  
          Cursor cursor=mDatabase.query(TABLE_NAME,
                  new String[]{USER_NAME,PASSWORD,SECURITY_Q_1,SECURITY_Q_2,SECURITY_Q_3}, " user_name=?", new String[]{USER_NAME}, null, null, null);
  
  
  
  
          Logger.log(Level.INFO, "Get count of username exists=", "" +  cursor.getCount());// always return 0
          if(count&gt;=1)
          {
              b=true;
              Logger.log(Level.INFO,TAG,"Username already exists inside table");
              return b;
  
  
          }
          Logger.log(Level.INFO,TAG,"Username is new  inside table");
          return b;
  
      }
  </code></pre>