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

Given that django-nonrel has got JOINs working, does this mean we have M2M fields
I have an application (winform exe) that I run several times. Does this mean
What does this mean: Next add reference to: MySql.Data actually I have downloaded mysql
does anybody have any idea what's does this mean: onLoad=MyOnLoad? thanks
Possible Duplicate: Reference - What does this symbol mean in PHP? I have a
I have this program, but cin in randomly skips.. I mean sometimes it does,
Does this mean I can't update another table from a trigger if I'm using
I've been fighting this all day. Inside my styles.xml file I have color information
What does this mean and why am I getting this error. Any suggestions on
What does this mean? * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*

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.