title: How to get the ringtone URI from the respective Ringtonemanager
body: <p>I want to have a custom ringtone. I am able to check for ringtones, but not able to set it as ringtone. I am having issues with finding the URI of that ringtone.</p>
  
  <pre><code>Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
              intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Select     
  ringtone:");
              intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, 
  true);
  
  intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE,RingtoneManager.TYPE_ALL);
              startActivityForResult(intent, 1);
  
  
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      if (resultCode == RESULT_OK) {
          switch (requestCode) {
              case 1:
                  /*Toast.makeText(getBaseContext(), 
   RingtoneManager.ID_COLUMN_INDEX, Toast.LENGTH_SHORT).show();
                    Uri targetUri = data.getData();*/
  
                  Uri uri = data.getData();
                  String[] ringTonePath = new String[0];
                      ringTonePath[0] = uri.getPath();
                      Cursor c = getContentResolver().query(uri, ringTonePath, null, null, null);
                      int columnIndex = c.getColumnIndex(ringTonePath[0]);
                      String tonepath = c.getString(columnIndex);
                      toneurl.setText(tonepath);
                      Log.w("Path of tone from 
      home......******************.........", tonepath + "");
  
     RingtoneManager.setActualDefaultRingtoneUri(getApplicationContext(), 
     RingtoneManager.TYPE_NOTIFICATION, uri);
  
                      break;
  
              default:
                  break;
          }
  </code></pre>