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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:51:07+00:00 2026-05-24T02:51:07+00:00

What does this mean? I have been fighting with this ListView that I have

  • 0

What does this mean? I have been fighting with this ListView that I have using an ArrayAdapter. I wrote this nice dialog fragment that I have calling back to an updateUI listner cause I want to update this ListView I have in my fragment from the DialogFragment at first the ArrayAdapter was a complex type of a class i Created:

ArrayAdapter<Location> theLocations;
...
//in oncreateview
theLocations = new ArrayAdapter<Location>(mContext, R.layout.location_row, locations);
//here locations is an ArrayList<Location>

then I have:

public void onUIUpdate(Location l) { //called from dialog fragment      
 locations.add(l);                  
 theLocations.notifyDataSetChanged();       
}

then that gave the above error so I switched it to use just a

String[] locationNames = new String[sizeofLocations];
theLocations=new ArrayAdapter<String>(mContext, R.layout.location_Row, locationNames );

public void onUIUpdate(Location l) {        
    locations.add(l);                   
            locationNames = new String[locations.size()];
            for(locations.size() etc...) { 
               locationNames [i] = new String(locations.get(i).getName());
            }
    theLocations.notifyDataSetChanged();        
}

this didn’t error out in my update method (That updates the ui) but it didn’t update anything. So I am lost as to how to update this ArrayAdapter, I thought notifyChange was supposed to do it, but it either does nothing or throws the above error.

I have no issues with my SimpleCursorAdapters elsewhere in my program (As long as my cursors remain open and i call a requery on them).

Any insights into what I am doing wrong?

Upon request here is my layout for the R.layout.location_row

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content" android:layout_width="fill_parent"     android:orientation="horizontal">   
<TextView android:text="@+id/TextView01" android:layout_height="wrap_content" android:id="@+id/location_name"
    android:textSize="15px" android:layout_marginTop="10px" android:layout_width="wrap_content"></TextView>
<TextView android:text="|" android:layout_height="wrap_content" 
    android:textSize="15px" android:layout_marginTop="6px" android:layout_width="wrap_content"></TextView>
<TextView android:text="@+id/TextView01" android:layout_height="wrap_content" android:id="@+id/location_lat"
    android:textSize="15px" android:layout_marginTop="6px" android:layout_width="wrap_content"></TextView>
<TextView android:text="|$" android:layout_height="wrap_content" 
    android:textSize="15px" android:layout_marginTop="6px" android:layout_width="wrap_content"></TextView>  
<TextView android:text="@+id/TextView01" android:layout_height="wrap_content" android:id="@+id/location_lon"
    android:textSize="15px" android:layout_marginTop="6px" android:layout_width="wrap_content"></TextView>
</LinearLayout> 
  • 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-05-24T02:51:08+00:00Added an answer on May 24, 2026 at 2:51 am

    As we can read in http://developer.android.com/reference/android/widget/ArrayAdapter.html
    ArrayAdapter just works with strings on textviews. You can use this constructor

    ArrayAdapter(Context context, int resource, int textViewResourceId, List<T> objects)
    

    specifyng the id of a TextView inside your layout or override

    getView(int, View, ViewGroup) 
    

    returning a view of your custom type.

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

Sidebar

Related Questions

For software applications like games, does this mean software companies have a lot of
I've been fighting this all day. Inside my styles.xml file I have color information
I have been using Perl for some time, but today I came across this
What does this mean exactly? I'm doing something like this: File.Copy(@\\foo\bar\baz.txt, @c:\test\baz.txt); MSDN doesn't
Exception Thrown: System.ComponentModel.ReflectPropertyDescriptor is not marked as Serializable Does this mean I missed marking
Strange program hang, what does this mean in debug? After attaching windbg I found
My designer keeps throwing out the term liquid layout. What does this mean? Thanks
What does it mean to call a class like this: class Example { public:
This question originally asked (wrongly) what does | mean in Python, when the actual
What does the following mean? Class.Function(variable := 1 + 1) What is this operator

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.