title: Insert SMS programmatically on Android 4.4.2
body: <p>I have the following code which works fine in older versions of Android, but not on 4.4.2. No errors occur and nothing in logcat, but the messages do not show up in the default SMS app in the emulator. So my question is why it doesn't work on 4.4.2 and what I have to do to make it work again.</p>
  
  <pre><code>private void addSMS()
  {       
      Uri uri = Uri.parse("content://sms/");
      ContentValues cv2 = new ContentValues();
      cv2.put("address", "+91956322222");
      cv2.put("date", "1309632433677");
      cv2.put("read", 1);
      cv2.put("type", 2);
      cv2.put("body", "Hey");
      getContentResolver().insert(uri, cv2);
      /** This is very important line to solve the problem */
      getContentResolver().delete(Uri.parse("content://sms/conversations/-1"), null, null);
      cv2.clear();
    }
  </code></pre>