* bundle.putString(Contacts.Intents.Insert.NAME, "Jenny");
* bundle.putString(Contacts.Intents.Insert.PHONE, "8675309");
* bundle.putString(Contacts.Intents.Insert.EMAIL, "jenny@the80s.com");
+ * bundle.putString(Contacts.Intents.Insert.POSTAL, "123 Fake St. San Francisco, CA 94102");
* intent.putExtra(Intents.Encode.DATA, bundle);
*/
public static final String CONTACT = "CONTACT_TYPE";
Bundle bundle = intent.getBundleExtra(Intents.Encode.DATA);
if (bundle != null) {
String name = bundle.getString(Contacts.Intents.Insert.NAME);
- if (name != null && !name.equals("")) {
+ if (name != null && name.length() > 0) {
mContents = "MECARD:N:" + name + ";";
mDisplayContents = name;
+ String address = bundle.getString(Contacts.Intents.Insert.POSTAL);
+ if (address != null && address.length() > 0) {
+ mContents += "ADR:" + address + ";";
+ mDisplayContents += "\n" + address;
+ }
String phone = bundle.getString(Contacts.Intents.Insert.PHONE);
- if (phone != null && !phone.equals("")) {
+ if (phone != null && phone.length() > 0) {
mContents += "TEL:" + phone + ";";
mDisplayContents += "\n" + phone;
}
String email = bundle.getString(Contacts.Intents.Insert.EMAIL);
- if (email != null && !email.equals("")) {
+ if (email != null && email.length() > 0) {
mContents += "EMAIL:" + email + ";";
mDisplayContents += "\n" + email;
}
bundle.putString(Contacts.Intents.Insert.NAME, "Jenny");
bundle.putString(Contacts.Intents.Insert.PHONE, "8675309");
bundle.putString(Contacts.Intents.Insert.EMAIL, "jenny@the80s.com");
+ bundle.putString(Contacts.Intents.Insert.POSTAL, "123 Fake St. San Francisco, CA 94102");
encodeBarcode("CONTACT_TYPE", bundle);
}
};