Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8519865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:22:20+00:00 2026-06-11T06:22:20+00:00

I have 3 email’s of the same contact. I need to update this emails

  • 0

I have 3 email’s of the same contact. I need to update this emails to phone book of Android. The problem is that when I try do this, the 3 email’s are updated the same way. The 3 email’s stay equals. Exist any way to distinguish the emails?

Here is my code

if(numEmails>1){
     int auxNumEmails=1;
     String tagEtEmail = "ete";
     String tagBtnLabelEmail = "btnLabelMail";
     //Determinar o número de email do content
     do{
         EditText etEmail = (EditText)contentEmail.findViewWithTag(tagEtEmail);
         Button etBtnLabelEmail = (Button)contentEmail.findViewWithTag(tagBtnLabelEmail);
         String stEtEmail = etEmail.getText().toString();
         String stBtnLabelEmail = etBtnLabelEmail.getText().toString();
         values.clear();

         String mailWhere = ContactsContract.Data.CONTACT_ID + "=? AND " + ContactsContract.Data.MIMETYPE + "=?" + ContactsContract.CommonDataKinds.Email.DATA+"=?"; 
         String[] mailWhereParams = new String[]{String.valueOf(idContacto),ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE, "2"}; 
         values.put(ContactsContract.CommonDataKinds.Email.DATA,stEtEmail);

         if(stBtnLabelEmail == "Residência"){
         values.put(ContactsContract.CommonDataKinds.Email.TYPE,ContactsContract.CommonDataKinds.Email.TYPE_HOME);
         values.put(ContactsContract.CommonDataKinds.Email.LABEL,stBtnLabelEmail);
         }
         else
             if(stBtnLabelEmail == "Emprego"){
                 values.put(ContactsContract.CommonDataKinds.Email.TYPE,ContactsContract.CommonDataKinds.Email.TYPE_WORK);
                 values.put(ContactsContract.CommonDataKinds.Email.LABEL,stBtnLabelEmail);
             }
         **cr.update(ContactsContract.Data.CONTENT_URI, values, mailWhere, mailWhereParams);**

     tagEtEmail = "ete"+auxNumEmails;
     tagBtnLabelEmail = "btnLabelMail" + auxNumEmails;
     auxNumEmails++;

     }while(auxNumEmails<=numEmails);

I need a way to distinguish the emails. Id? But how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:22:22+00:00Added an answer on June 11, 2026 at 6:22 am

    The solution that i use to distinguish diferent emails for the same contact is use the tag atribute. Each email have a diferent tag that allow distinguish each one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this email sending code that does not show a chooser (good). How
I have email function that send 5 person at one time. I call this
I have an Email-listening application that handles incoming mails, depending on the Bucket (or
I have an email attachment form that is working fine when the <form action=processingtheformfile.php>
You've probably seen web apps that have an email dropbox. Users can send email
I have an email delegate method that shows a result message. After the result
I have a string that could have email address in two different ways way
I have an email that I'm reading with the Python email lib that I
I am have the following code for excel vba that will email a range
We are using Sitecore 6.5 and we have Email campaigns setup and the emails

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.