Android show selected ringtone
<p>In my app,there is a option to change a ringtone. Ringtone picker pops up and user can change it. So when restart the tablet that ringtone is set but not marked on the picker. How can I do that ? In other works, ringtone picker shows that there is no rightone set.</p>

<pre><code>private void setRington()
{
    Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
    intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, "Select ringtone for notifications:");
    intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, false);
    intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);
    if (notification_uri == null)
    {
        intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, (Uri)null);
    }
    else
    {
        intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, Uri.parse(notification_uri));
    }
    startActivityForResult(intent, 5);
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
    if (resultCode == Activity.RESULT_OK &amp;&amp; requestCode == 5)
    {
        Uri uri = data.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
         if (uri != null)
        {
            RingtoneManager.setActualDefaultRingtoneUri(this, RingtoneManager.TYPE_RINGTONE, uri);
            Settings.System.putString(getContentResolver(), Settings.System.NOTIFICATION_SOUND, uri.toString());
            notification_uri = uri.toString();
        }
    }
}
</code></pre>
