Android: save sound as ringtone / SQLiteConstraintException

前端 未结 2 1463
粉色の甜心
粉色の甜心 2021-01-14 05:31

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.

2条回答
  •  悲&欢浪女
    2021-01-14 06:19

    I was having the same issue....it's because you don't have this permission in your manifest

    
    

    Also, if you're using that tutorial, make sure you have this in your manifest as well...

    
    

    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.

提交回复
热议问题