title: Android: null string issue for 'address' column for sms content provider
body: <p>I am working on a android application which read the sms from content provider. The application works fine and read sms fine from content provider. But sometime (very rare) the 'address' column returns null for the sms message. </p>
  
  <p>Here is sample code What I am using:</p>
  
  <pre><code>String whereClause = "_id &gt; " + String.valueOf(Database.getLastSmsId(this));
          Cursor cursor = getContentResolver().query(smsUri, null, whereClause, null, null);
          if(cursor.moveToFirst()) {
              do {
                  int id = cursor.getInt(cursor.getColumnIndex("_id"));
              String protocol = cursor.getString(cursor.getColumnIndex("protocol"));
              String body = cursor.getString(cursor.getColumnIndex("body"));
  
              String address = cursor.getString(cursor.getColumnIndex("address")); // &lt;----- Here is the problem
              // address returns as null string
  
              String date = cursor.getString(cursor.getColumnIndex("date"));
  
                  Log.d(Constants.TAG, "SMS event received. address="+address);
              } while(cursor.moveToNext());
      }
  </code></pre>
  
  <p>I am getting this issue on Motorola Driod Android v2.3.5. Please advise.</p>
  
  <p>Ali</p>