本文整理汇总了Java中com.google.zxing.client.result.AddressBookParsedResult.getNames方法的典型用法代码示例。如果您正苦于以下问题:Java AddressBookParsedResult.getNames方法的具体用法?Java AddressBookParsedResult.getNames怎么用?Java AddressBookParsedResult.getNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.zxing.client.result.AddressBookParsedResult
的用法示例。
在下文中一共展示了AddressBookParsedResult.getNames方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleButtonPress
import com.google.zxing.client.result.AddressBookParsedResult; //导入方法依赖的package包/类
@Override
public void handleButtonPress(int index) {
AddressBookParsedResult addressResult = (AddressBookParsedResult) getResult();
String[] addresses = addressResult.getAddresses();
String address1 = addresses == null || addresses.length < 1 ? null : addresses[0];
String[] addressTypes = addressResult.getAddressTypes();
String address1Type = addressTypes == null || addressTypes.length < 1 ? null : addressTypes[0];
int action = mapIndexToAction(index);
switch (action) {
case 0:
addContact(addressResult.getNames(),
addressResult.getPronunciation(),
addressResult.getPhoneNumbers(),
addressResult.getPhoneTypes(),
addressResult.getEmails(),
addressResult.getEmailTypes(),
addressResult.getNote(),
addressResult.getInstantMessenger(),
address1,
address1Type,
addressResult.getOrg(),
addressResult.getTitle(),
addressResult.getURL(),
addressResult.getBirthday());
break;
case 1:
String[] names = addressResult.getNames();
String title = names != null ? names[0] : null;
searchMap(address1, title);
break;
case 2:
dialPhone(addressResult.getPhoneNumbers()[0]);
break;
case 3:
sendEmail(addressResult.getEmails()[0], null, null);
break;
default:
break;
}
}
示例2: handleButtonPress
import com.google.zxing.client.result.AddressBookParsedResult; //导入方法依赖的package包/类
@Override
public void handleButtonPress(int index) {
AddressBookParsedResult addressResult = (AddressBookParsedResult) getResult();
String[] addresses = addressResult.getAddresses();
String address1 = addresses == null || addresses.length < 1 ? null : addresses[0];
String[] addressTypes = addressResult.getAddressTypes();
String address1Type = addressTypes == null || addressTypes.length < 1 ? null : addressTypes[0];
int action = mapIndexToAction(index);
switch (action) {
case 0:
addContact(addressResult.getNames(), addressResult.getPronunciation(), addressResult.getPhoneNumbers(),
addressResult.getPhoneTypes(), addressResult.getEmails(), addressResult.getEmailTypes(),
addressResult.getNote(), addressResult.getInstantMessenger(), address1, address1Type,
addressResult.getOrg(), addressResult.getTitle(), addressResult.getURL(),
addressResult.getBirthday());
break;
case 1:
String[] names = addressResult.getNames();
String title = names != null ? names[0] : null;
searchMap(address1, title);
break;
case 2:
dialPhone(addressResult.getPhoneNumbers()[0]);
break;
case 3:
sendEmail(addressResult.getEmails()[0], null, null);
break;
default:
break;
}
}
开发者ID:thomas-bornschlegel,项目名称:AndroidMultiChannelMiddleware,代码行数:32,代码来源:AddressBookResultHandler.java
示例3: handleButtonPress
import com.google.zxing.client.result.AddressBookParsedResult; //导入方法依赖的package包/类
@Override
public void handleButtonPress(int index) {
AddressBookParsedResult addressResult = (AddressBookParsedResult) getResult();
String[] addresses = addressResult.getAddresses();
String address1 = addresses == null || addresses.length < 1 ? null : addresses[0];
int action = mapIndexToAction(index);
switch (action) {
case 0:
addContact(addressResult.getNames(), addressResult.getPhoneNumbers(),
addressResult.getEmails(), addressResult.getNote(),
address1, addressResult.getOrg(),
addressResult.getTitle());
break;
case 1:
String[] names = addressResult.getNames();
String title = names != null ? names[0] : null;
searchMap(address1, title);
break;
case 2:
dialPhone(addressResult.getPhoneNumbers()[0]);
break;
case 3:
sendEmail(addressResult.getEmails()[0], null, null);
break;
default:
break;
}
}
示例4: handleButtonPress
import com.google.zxing.client.result.AddressBookParsedResult; //导入方法依赖的package包/类
@Override
public void handleButtonPress(int index) {
AddressBookParsedResult addressResult = (AddressBookParsedResult) getResult();
String[] addresses = addressResult.getAddresses();
String address1 = addresses == null || addresses.length < 1 ? null : addresses[0];
String[] addressTypes = addressResult.getAddressTypes();
String address1Type = addressTypes == null || addressTypes.length < 1 ? null : addressTypes[0];
int action = mapIndexToAction(index);
switch (action) {
case 0:
addContact(addressResult.getNames(),
addressResult.getNicknames(),
addressResult.getPronunciation(),
addressResult.getPhoneNumbers(),
addressResult.getPhoneTypes(),
addressResult.getEmails(),
addressResult.getEmailTypes(),
addressResult.getNote(),
addressResult.getInstantMessenger(),
address1,
address1Type,
addressResult.getOrg(),
addressResult.getTitle(),
addressResult.getURLs(),
addressResult.getBirthday(),
addressResult.getGeo());
break;
case 1:
String[] names = addressResult.getNames();
String title = names != null ? names[0] : null;
searchMap(address1, title);
break;
case 2:
dialPhone(addressResult.getPhoneNumbers()[0]);
break;
case 3:
sendEmail(addressResult.getEmails()[0], null, null);
break;
default:
break;
}
}
示例5: encodeQRCodeContents
import com.google.zxing.client.result.AddressBookParsedResult; //导入方法依赖的package包/类
private boolean encodeQRCodeContents(AddressBookParsedResult contact) {
StringBuilder newContents = new StringBuilder(100);
StringBuilder newDisplayContents = new StringBuilder(100);
newContents.append("MECARD:");
String[] names = contact.getNames();
if (names != null && names.length > 0) {
String name = trim(names[0]);
if (name != null) {
newContents.append("N:").append(escapeMECARD(name)).append(';');
newDisplayContents.append(name);
}
}
String[] addresses = contact.getAddresses();
if (addresses != null) {
for (String address : addresses) {
address = trim(address);
if (address != null) {
newContents.append("ADR:").append(escapeMECARD(address))
.append(';');
newDisplayContents.append('\n').append(address);
}
}
}
String[] phoneNumbers = contact.getPhoneNumbers();
if (phoneNumbers != null) {
for (String phone : phoneNumbers) {
phone = trim(phone);
if (phone != null) {
newContents.append("TEL:").append(escapeMECARD(phone))
.append(';');
newDisplayContents.append('\n').append(
PhoneNumberUtils.formatNumber(phone));
}
}
}
String[] emails = contact.getEmails();
if (emails != null) {
for (String email : emails) {
email = trim(email);
if (email != null) {
newContents.append("EMAIL:").append(escapeMECARD(email))
.append(';');
newDisplayContents.append('\n').append(email);
}
}
}
String url = trim(contact.getURL());
if (url != null) {
newContents.append("URL:").append(escapeMECARD(url)).append(';');
newDisplayContents.append('\n').append(url);
}
// Make sure we've encoded at least one field.
if (newDisplayContents.length() > 0) {
newContents.append(';');
contents = newContents.toString();
displayContents = newDisplayContents.toString();
title = activity.getString(R.string.contents_contact);
return true;
} else {
contents = null;
displayContents = null;
return false;
}
}
示例6: handleButtonPress
import com.google.zxing.client.result.AddressBookParsedResult; //导入方法依赖的package包/类
@Override
public void handleButtonPress(int index) {
AddressBookParsedResult addressResult = (AddressBookParsedResult) getResult();
String[] addresses = addressResult.getAddresses();
String address1 = addresses == null || addresses.length < 1 ? null : addresses[0];
String[] addressTypes = addressResult.getAddressTypes();
String address1Type = addressTypes == null || addressTypes.length < 1 ? null : addressTypes[0];
int action = mapIndexToAction(index);
switch (action) {
case 0:
addContact(addressResult.getNames(),
addressResult.getNicknames(),
addressResult.getPronunciation(),
addressResult.getPhoneNumbers(),
addressResult.getPhoneTypes(),
addressResult.getEmails(),
addressResult.getEmailTypes(),
addressResult.getNote(),
addressResult.getInstantMessenger(),
address1,
address1Type,
addressResult.getOrg(),
addressResult.getTitle(),
addressResult.getURLs(),
addressResult.getBirthday(),
addressResult.getGeo());
break;
case 1:
String[] names = addressResult.getNames();
String title = names != null ? names[0] : null;
searchMap(address1, title);
break;
case 2:
dialPhone(addressResult.getPhoneNumbers()[0]);
break;
case 3:
sendEmail(addressResult.getEmails()[0], null, null);
break;
default:
break;
}
}
示例7: encodeQRCodeContents
import com.google.zxing.client.result.AddressBookParsedResult; //导入方法依赖的package包/类
private boolean encodeQRCodeContents(AddressBookParsedResult contact) {
StringBuilder newContents = new StringBuilder(100);
StringBuilder newDisplayContents = new StringBuilder(100);
newContents.append("MECARD:");
String[] names = contact.getNames();
if (names != null && names.length > 0) {
String name = trim(names[0]);
if (name != null) {
newContents.append("N:").append(escapeMECARD(name)).append(';');
newDisplayContents.append(name);
}
}
String[] addresses = contact.getAddresses();
if (addresses != null) {
for (String address : addresses) {
address = trim(address);
if (address != null) {
newContents.append("ADR:").append(escapeMECARD(address)).append(';');
newDisplayContents.append('\n').append(address);
}
}
}
String[] phoneNumbers = contact.getPhoneNumbers();
if (phoneNumbers != null) {
for (String phone : phoneNumbers) {
phone = trim(phone);
if (phone != null) {
newContents.append("TEL:").append(escapeMECARD(phone)).append(';');
newDisplayContents.append('\n').append(PhoneNumberUtils.formatNumber(phone));
}
}
}
String[] emails = contact.getEmails();
if (emails != null) {
for (String email : emails) {
email = trim(email);
if (email != null) {
newContents.append("EMAIL:").append(escapeMECARD(email)).append(';');
newDisplayContents.append('\n').append(email);
}
}
}
String url = trim(contact.getURL());
if (url != null) {
newContents.append("URL:").append(escapeMECARD(url)).append(';');
newDisplayContents.append('\n').append(url);
}
// Make sure we've encoded at least one field.
if (newDisplayContents.length() > 0) {
newContents.append(';');
contents = newContents.toString();
displayContents = newDisplayContents.toString();
title = activity.getString(R.string.contents_contact);
return true;
} else {
contents = null;
displayContents = null;
return false;
}
}