使用此代码查找:
try
{
Log.d("Notification Sound",Settings.System.getInt( context.getContentResolver() ,
Settings.System.NOTIFICATION_SOUND)+" ");
}
catch (Settings.SettingNotFoundException e)
{
e.printStackTrace();
Log.d("Notification Sound error",e.getCause()+" ");
}
在Android 9设备中获取Settings.SettingNotFoundException。