title: setting audio file as Ringtone
body: <p>I have save file in <code>sdcard/media/audio/ringtone</code>s folder. That file will appear in list of ringtone selection from <code>settings/sound/phone</code> Ringtone.</p>
  
  <p>But I want to set that file as a ringtone from my code.
  Here is my code.</p>
  
  <pre><code>  File k = new File(path, filename);
  
    ContentValues values = new ContentValues();
    values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());
    values.put(MediaStore.MediaColumns.TITLE, "TwiAppclip");
    values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/*");
    values.put(MediaStore.Audio.Media.ARTIST, "cssounds ");
    values.put(MediaStore.Audio.Media.IS_RINGTONE, true);
    values.put(MediaStore.Audio.Media.IS_NOTIFICATION, false);
    values.put(MediaStore.Audio.Media.IS_ALARM, false);
    values.put(MediaStore.Audio.Media.IS_MUSIC, false);
  
    Uri uri = MediaStore.Audio.Media.getContentUriForPath(k
         .getAbsolutePath());
    Uri newUri = getApplicationContext().getContentResolver().insert(uri, values);
  
    RingtoneManager.setActualDefaultRingtoneUri(getApplicationContext(),
        RingtoneManager.TYPE_RINGTONE, newUri);
  </code></pre>
  
  <p>here <code>uri</code> I am getting But I got <code>newUri = null</code>. I think that's why its is not setting as ringtone.</p>
  
  <p>Anyone know where is the problem? how do I get <code>newUri</code> proper?</p>