How to set ringtone in Android from my activity?

后端 未结 9 1560
一个人的身影
一个人的身影 2020-11-22 12:11

I\'m trying to find a way to set a new default ringtone by code from my Android activity.

I have already downloaded the ringtone into a bytearray.

9条回答
  •  温柔的废话
    2020-11-22 12:28

    I found this code from the Media application from Android.

    Settings.System.putString(resolver, 
    Settings.System.RINGTONE, ringUri.toString());
    

    this works form my.

提交回复
热议问题