Reputation: 3364
I have been trying to save contact into contact book via the following code,
Intent intent = new Intent(Intent.ACTION_INSERT);
intent.putExtra(ContactContracts.Intents.NAME, "Ryan");
While the above code works perfectly on most of the devices but not working in Oxygen OS 11 One plus devices. The name field comes empty while saving while other fields are inserted properly The code works fine on Android 11 emulator and the issue seems to be specific to Oxygen OS 11. I assume they replaced the accepted "key" for name field in ContactsContract class.
Upvotes: 0
Views: 18
Reputation: 3364
For anyone still looking for an answer,
I tried changing the key, it does not work. What worked for me is either opening google contacts / adding contact directly via content provider.
Upvotes: 0