简体   繁体   English

无法在 Oxygen OS 11 的通讯录中保存姓名字段

[英]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.虽然上面的代码在大多数设备上都能完美运行,但在 Oxygen OS 11 One plus 设备上却无法运行。 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.名称字段在保存时为空,而其他字段已正确插入代码在 Android 11 模拟器上运行良好,问题似乎特定于 Oxygen OS 11。我假设他们替换了 ContactsContract class 中名称字段接受的“密钥”。

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.对我有用的是打开谷歌联系人/直接通过内容提供商添加联系人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 RadioInfo 的 OS11 替代品? - OS11 replacement for RadioInfo? 保存在通讯录中适用于 Android 10 但不适用于 Android 11 - Save in Contacts works in Android 10 but not in Android 11 如何从具有 OS 11 的 Android 设备获取 mac 地址? - How to get mac Address from an Android Device with OS 11? Android 11: avc: denied { read } for name="sdcard" - Android 11: avc: denied { read } for name="sdcard" 无法将文件路径传递给 Android 11 中的 MediaRecorder - Cannot pass filepath to MediaRecorder in Android 11 无法在 Android 11(Wi-Fi Direct)上使用 WifiP2pManager.setDeviceName - Cannot use WifiP2pManager.setDeviceName on Android 11 (Wi-Fi Direct) "如何在 Android 11 或 Android Q 中保存视频文件" - How to save video file in Android 11 or Android Q android 11中/storage/emulated/路径下的read.txt字段数据 - Read .txt field data from /storage/emulated/ path in android 11 无法访问 flutter 中 android 版本 11 设备上的隐藏文件夹 - Cannot access hidden folder on android version 11 device in flutter 我的 Flutter 应用程序无法在 Android 11 上运行,但在模拟器和 android 8 上运行良好 || (操作系统错误:不允许操作,errno = 1) - My Flutter App is Not Working on Android 11 But Working fine in emulator as well as android 8 || (OS Error: Operation not permitted, errno = 1)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM