• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Sorting the name list in my app - SettingNotFoundException

I'm writing an application which sorts the names of employees based on the user's selection in his/her Contacts settings.

I have implemented the following code in my application for fetching the sort order from device's Contacts:

int sortOrder = 0;

try{
sortOrder = android.provider.Settings.System.getInt(context.getContentResolver(), "android.contacts.DISPLAY_ORDER");
} catch (android.provider.Settings.SettingNotFoundException e) {
Log.e("Setting Not Found", e.getMessage());
}
My application is working fine with below 5.0 version devices, but i have a problem with Nexus5 (6.0). It always throws:

android.provider.Settings$SettingNotFoundException: android.contacts.DISPLAY_ORDER

Can any one please help me to resolve this issue?
 
It appears that nobody here knows the answer to your question. Have you tried asking on StackOverflow?
 
I've not coded or used anything like this, but it kind of sounds / looks to me like it might be a permissions issue / change that might have occurred in 6.0? (i.e., is there someone else you need to request (permission-wise) for 6.0?)
 
I've not coded or used anything like this, but it kind of sounds / looks to me like it might be a permissions issue / change that might have occurred in 6.0? (i.e., is there someone else you need to request (permission-wise) for 6.0?)
I tried all the possible ways, runtime permission manifest permissions but still its throwing exception. Thanks a lot for your reply
 
Back
Top Bottom