黑莓 - 从地址簿联系人列表中读取自定义铃声名称?
实际上,我正在为自定义数据库联系人列表中的联系人号码分配自定义铃声。 现在我在读取该联系人列表时遇到问题。 如果有人对这个问题有任何想法请帮忙。
更新
public void showAddressBook() {
try {
ContactList contactList = (ContactList) PIM.getInstance()
.openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);
Enumeration enumx = contactList.items();
while (enumx.hasMoreElements()) {
Contact c = (Contact) enumx.nextElement();
int[] fieldIds = c.getFields();
System.out.println("SHOW:" + c.EXTENDED_FIELD_MIN_VALUE);
int id;
for (int index = 0; index < fieldIds.length; ++index) {
id = fieldIds[index];
System.out.println(c.getPIMList().getFieldLabel(id)
+ "==showAddressBook==" + fieldIds.length);
if (c.getPIMList().getFieldDataType(id) == Contact.STRING) {
for (int j = 0; j < c.countValues(id); ++j) {
String value = c.getString(id, j);
System.out.println(c.getPIMList().getFieldLabel(id)
+ "=" + value);
}
}
}
}
} catch (PIMException ex) {
ex.printStackTrace();
}
}
Actually I am assigning custom ringtone with contact number in a custom database contact list.
Now I am having problem with the reading to that contact list.
If anyone having any idea about this problem pls pls help.
UPDATE
public void showAddressBook() {
try {
ContactList contactList = (ContactList) PIM.getInstance()
.openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);
Enumeration enumx = contactList.items();
while (enumx.hasMoreElements()) {
Contact c = (Contact) enumx.nextElement();
int[] fieldIds = c.getFields();
System.out.println("SHOW:" + c.EXTENDED_FIELD_MIN_VALUE);
int id;
for (int index = 0; index < fieldIds.length; ++index) {
id = fieldIds[index];
System.out.println(c.getPIMList().getFieldLabel(id)
+ "==showAddressBook==" + fieldIds.length);
if (c.getPIMList().getFieldDataType(id) == Contact.STRING) {
for (int j = 0; j < c.countValues(id); ++j) {
String value = c.getString(id, j);
System.out.println(c.getPIMList().getFieldLabel(id)
+ "=" + value);
}
}
}
}
} catch (PIMException ex) {
ex.printStackTrace();
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
RIM API 文档中没有提及联系自定义铃声...
BlackBerry 支持社区论坛:Java 开发:回复:联系人中的自定义铃声字段
There is no reference to Contact Custom Ringtone in RIM API documentation...
BlackBerry Support Community Forums:Java Development:Re: Custom ringtone field in Contacts