mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
@@ -134,6 +134,7 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
||||
private void updateRingtoneDescription()
|
||||
{
|
||||
String ringtoneName = ReminderHelper.getRingtoneName(getContext());
|
||||
if(ringtoneName == null) return;
|
||||
Preference ringtonePreference = findPreference("reminderSound");
|
||||
ringtonePreference.setSummary(ringtoneName);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,10 @@ public class ReminderHelper
|
||||
fragment.startActivityForResult(intent, requestCode);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String getRingtoneName(Context context)
|
||||
{
|
||||
try
|
||||
{
|
||||
Uri ringtoneUri = getRingtoneUri(context);
|
||||
String ringtoneName = context.getResources().getString(R.string.none);
|
||||
@@ -161,4 +164,10 @@ public class ReminderHelper
|
||||
|
||||
return ringtoneName;
|
||||
}
|
||||
catch (RuntimeException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user