我想获取手机铃声,但只能看到英文(非本地化版本)。
我的理论是使用 ContextWrapper,并将该上下文语言环境设置为en_US
并将该新语言环境传递给RingtoneManager.getRingtone()
(基于以编程方式设置语言环境的代码):
ContextWrapper cw = new ContextWrapper(context);
Context cc = setContextLocale(cw, "en_US"); // This method was copied from the StackOverflow question above ^^
Ringtone defaultRingtone = RingtoneManager.getRingtone(cc, Settings.System.DEFAULT_RINGTONE_URI);
String sss = defaultRingtone.getTitle(cc);
所以,是的,这不能按预期工作。有任何想法吗?