Blackberry - 如何从 PIMItem 获取字段标签
我们如何从 PIMItem 获取字段标签。以下代码是 PIMList
String label = pimList.getAttributeLabel(
blackBerryContact.getAttributes(Contact.TEL, i));
但我有 PIMItem。有一个方法 PIMItem.getPIMList()
在下面的代码中为我返回 null。 API 位于 http://www.blackberry.com/developers/docs /5.0.0api/index.html 表示“getPIMList() 获取与此项目关联的 PIMList。
”下面是我试图实现的示例代码 -
// Load the address Book and allow the user to select a contact
BlackBerryContactList contactList = (BlackBerryContactList)
PIM.getInstance().openPIMList(PIM.CONTACT_LIST,PIM.READ_ONLY);
PIMItem userSelectedContact = contactList.choose();
// Now get the Field labels for contact numbers for userSelectedContact
How can we get Field Labels from PIMItem. The following code is with PIMList
String label = pimList.getAttributeLabel(
blackBerryContact.getAttributes(Contact.TEL, i));
But i have PIMItem. There is a method PIMItem.getPIMList()
which returns null for me in the code below. THE API at http://www.blackberry.com/developers/docs/5.0.0api/index.html says "getPIMList()
" Below is sample code that i am trying to achive -
Gets the PIMList associated with this item.
// Load the address Book and allow the user to select a contact
BlackBerryContactList contactList = (BlackBerryContactList)
PIM.getInstance().openPIMList(PIM.CONTACT_LIST,PIM.READ_ONLY);
PIMItem userSelectedContact = contactList.choose();
// Now get the Field labels for contact numbers for userSelectedContact
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
感谢马克斯的回复。返回 NULL 问题是我的代码有问题,我已经纠正了。我还能够获取字段标签,但循环仅检索联系人名片上的字段。
我正在寻找 Contact.TEL 拥有的所有 8 个标签 -
所有 8 个标签可能都没有被用户使用,例如用户可能有 WORK、WORK2、HOME、HOME2 和 MOBILE。其他传真、寻呼机和其他可能未填写,我想获取所有允许的标签并更新空标签的给定号码。
我们如何检查和更新以下内容,
如果解释不清楚或需要更多详细信息,请告诉我。
Thanks Max for the response. The returning NULL issue was problem with my code which i have rectified. I was also able to get Labels for Fields, but the loop retrieves only fields that the Contact has on his card.
I am looking to get all the 8 labels that Contact.TEL has -
All the 8 Labels might not be in use in for a user, For e.g a user might have WORK, WORK2, HOME, HOME2 and MOBILE. Others FAX, PAGER and OTHER might not be filled i want to get all the allowed labels and update a given number for the one that is empty.
How can we check and update the following
Please let me know if the explanation is not clear, or some more details are required.