karan vs
karan vs

Reputation: 3364

Cannot save name field in contact book in Oxygen OS 11

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

Answers (1)

karan vs
karan vs

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

Related Questions