I\'m trying to save a sound as a ringtone in Android using this code. It works like a charm but will fail if I try to save a ringtone that has already been inserted.
I was having the same issue....it's because you don't have this permission in your manifest
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
Also, if you're using that tutorial, make sure you have this in your manifest as well...
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
I spent a good half an hour or so trying to figure out why the code wasn't working. I actually removed the try/catch just to see what type of error it would throw in the logcat, and it told me I was missing those permissions.
It is not caught because the exception is not in your code. It is not even in your process. It is in the process of the MediaStore
content provider.