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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:21:12+00:00 2026-06-15T13:21:12+00:00

private ArrayList<String> conversation = new ArrayList<String>(); public ArrayAdapter<String> adapter; private String phoneNumber; ListView listView;

  • 0
private ArrayList<String> conversation = new ArrayList<String>();
public ArrayAdapter<String> adapter;
private String phoneNumber;     
ListView listView;



protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.converse_view);

    this.adapter = new ArrayAdapter<String>(this,
            android.R.layout.simple_list_item_1, android.R.id.text1,
            conversation);

    ListView listView = (ListView) findViewById(R.id.conversation);
    listView.setAdapter(adapter);

}



protected void onResume()
{
   super.onResume();
   setContentView(R.layout.converse_view);
   this.adapter.notifyDataSetChanged();


}


public void changeNumber(String phoneNumber2) {
    this.phoneNumber = phoneNumber2;

}

public void addText(String message) {
    conversation.add(message);

}

@Override
public String toString() {
    return phoneNumber;
}

public boolean equals(converseView other) {
    return this.phoneNumber.equals(other.phoneNumber);
}

I am creating a text messaging app this is my class for the conversation view screen.
addText() is called when you click the send button. How do i get the list view to update so i can see what text messages where send

  • 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-15T13:21:14+00:00Added an answer on June 15, 2026 at 1:21 pm

    You need to add the message to the adapter, and notify the adapter that the list has changed.

    if (this.adapter!=null)
    {
      this.adapter.add(message);
      this.adapter.notifyDataSetChanged();
    }
    

    Basically, the last time that the adapter knows the state of conversation is at:

    this.adapter = new ArrayAdapter<String>(this,
            android.R.layout.simple_list_item_1, android.R.id.text1,
            conversation);
    

    This will add everything from the ArrayList to the ArrayAdapter, but it doesn’t link them together in any way.

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

Sidebar

Related Questions

`Adapter class ::: public class YAdapter extends ArrayAdapter<String> { ArrayList<String> items; Context context; private
public class XPBN extends Activity{ private Map _map; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState);
Here is my code: public class XMLGettersSetters { private ArrayList<String> country = new ArrayList<String>();
I 've the following custom adapter public class GroupAdapter extends ArrayAdapter<Group> { private ArrayList<Group>
Let's say I have this: public class Whatever { private ArrayList<String> myList = new
public class List_Items extends ListActivity{ private ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>(); public
Consider this code: package Prova; import java.util.ArrayList; public class Prova { private ArrayList<String> people;
private List<String> subList; private List<List<String>> records = new ArrayList<List<String>>(); for(....){ subList = new ArrayList<String>();
private final List<KeyListener> keyListeners= new CopyOnWriteArrayList<KeyListener>(); public void addKeyListener(KeyListener keyListener){ keyListeners.add(keyListener); } In the
I would like to do something like this: private ArrayList<String[]> addresses = new ArrayList<String[3]>();

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.