Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Number instead ringtone name

I want to get ringtone name. I use this code

Ringtone ringtone = RingtoneManager.getRingtone(preference.getContext(), Uri.parse(stringValue));
String name = ringtone.getTitle(preference.getContext());

And I get number (for example - 17090) not ringtone name. What's wrong?

like image 919
Bakus123 Avatar asked Sep 30 '22 02:09

Bakus123


2 Answers

I had this same problem with recent versions of Android (4.4). There must be an issue with getTitle() and external storage since it works fine on internal storage. I also found that read access will also work. That may be less invasive for users.

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
like image 83
Eric Avatar answered Nov 03 '22 00:11

Eric


I found answer. I added:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

and it works now!

But why this permission is needed?

like image 41
Bakus123 Avatar answered Nov 03 '22 02:11

Bakus123