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 8048023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:17:43+00:00 2026-06-05T06:17:43+00:00

I have a unique SMS problem: The end goal is to replace the phone

  • 0

I have a unique SMS problem:

The end goal is to replace the phone numbers displaying in my list to contact names

(These are all string arraylists)

ArrayList3 contains 6 elements that represents a selection of phone numbers.
ArrayList2 contains 31 elements representing all available phone numbers.
ArrayList1 contains 31 elements representing the names of all phone numbers in the same order respectively to ArrayList2.

How would I compare them all to this effect:

“If Arraylist3’s element is equal to an element in ArrayList2, copy ArrayList3 at the same position of ArrayList2 and place it into ArrayList3.”

Roughly, what Im trying to do is match the elements of ArrayList3 with identical elements in ArrayList2. From there, use the position of ArrayList2 to get the same position of ArrayList1, then copy the data at that position (ArrayList1) into ArrayList3.

Any ideas on how to achieve this?

  • 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-05T06:17:46+00:00Added an answer on June 5, 2026 at 6:17 am

    I have tried the following and it works for me:

    ArrayList<String> arrayList1 = new ArrayList<String>();
        ArrayList<String> arrayList2 = new ArrayList<String>();
        ArrayList<String> arrayList3 = new ArrayList<String>();
        arrayList1.add("Welcome");
        arrayList1.add("Home");
    
        arrayList2.add("1");
        arrayList2.add("2");
    
        arrayList3.add("2");
    
    
    
        for(int i=0; i< arrayList3.size(); i++){
            if(arrayList2.contains(arrayList3.get(i))){
                int index = arrayList2.indexOf(arrayList3.get(i));
                arrayList3.set(i, arrayList1.get(index));
                //Toast.makeText(this, "Found " + arrayList3.get(i), Toast.LENGTH_LONG).show();
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have unique id's for these but I want to change all div's with
All Hadoop jobs have unique jobid. You can use jobid to get job status
The problem is the following. There are multiple rows that have non-unique identifiers: id
I have various links which all have unique id's that are pseudo-anchors. I want
What I Want: I want to have unique Identifier for SMS and Contacts in
I have multiple elements on page and all of them have unique id something
In a system where registered objects must have unique names, I want to use/include
I have an SQL database with a set of tables that have Unique Id's.
I know that using the following codes will make each column have unique values,
I'm wondering if it is possible to have unique characters that cannot be seen

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.