title: How to use Correct Conditioning?
body: <p><strong>Is this the correct query?</strong></p>
  
  <pre><code>DbFertility info = new DbFertility(this);
          info.open();
          String name = info.getUserInfo();
          info.close();
  
          if(name != null){
              Intent i = new Intent(this, Create.class);
              startActivity(i);
          }else{
              Intent i2 = new Intent(this, CalendarMain.class);
              startActivity(i2);
          }
  </code></pre>
  
  <p>problem: if the name null i want to direct it create class.. my real problem is even my name is empty or not it always direct me to the CalendarMain.(help)</p>
  
  <pre><code> public String getUserInfo() { 
        String[] columns = new String[]{KEY_USER_ID, KEY_NAME, KEY_AGE, KEY_STATUS}; 
        Cursor c = getOurDatabase().query(TABLE_USER, columns, null, null, null, null, null); 
        String result = ""; 
        int iRow = c.getColumnIndex(KEY_USER_ID); 
        int iName = c.getColumnIndex(KEY_NAME); 
        int iAge c.getColumnIndex(KEY_AGE);
        int iStatus = c.getColumnIndex(KEY_STATUS); 
        for(c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) { 
             result = result + c.getString(iName) + " " + c.getString(iAge) + c.getString(iStatus) + "\n"; 
        }
        return result;
  }
  </code></pre>
  
  <p>Save:</p>
  
  <pre><code>  public long createUser(String name, String age, String status) {           
          ContentValues cv = new ContentValues(); 
          cv.put(KEY_NAME, name); 
          cv.put(KEY_AGE, age); 
          cv.put(KEY_STATUS, status); 
          return getOurDatabase().insert(TABLE_USER, null, cv);
    }
  </code></pre>