arrayadapter

When using ArrayAdaptor in Android, The data isn't shown.

Hi, I'm writing an Android App that loads in data from an RSS Feed and lists the available items, and their description. There are 2 instances in which I use ArrayAdaptor. One works and one does not. The first one lists available feeds (right now the feed URLs are hard coded), and that one works. MainActivity.java public void onCreate...

Two independent ListViews on the same screen + TextView header

I have two ListViews, each of them containing a String[] that I created locally. I wanted to show both of them on the same screen, but still maintaining their properties (List 1 having its background color, while List 2 has its). Can this be accomplished? Also, I'm trying to add a locally created TextView to the screen; I've tried addHe...

Android ArrayAdapter & ListView slowness

Hello, To display & load images in my ListView I've created a custom ArrayAdapter, however it is really slow. Every time I scroll through the list it loads the images again. Is there a caching mechanism which will cache my Views so I don't need to refill them every time? I know about the ViewHolder method, however this still is slow or...

Context menu in list activity.

Hi. I have list activity with custom array adapter and I can't to get context menu when make long press on list item. <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <FrameLayout android:id="@android:id/tabcontent" ...

Android ArrayAdapter Filtering problems

While working on this app, I wanted to use a Custom List Adapter so that I could style the list but the Filter functionality is not working. I got the basic filtering to work but the application crashes as soon as the list of filtered results is less than the number of listItems shown when I start filtering. There is also a second probl...

Can't click on ListView whose rows are made of WebViews

Hi, I have an Activity which extends ListView The ListView that I use is an extension of ArrayAdapter and each row of the ListView primarily consists of a WebView The problem is that touching the WebView does not call OnListItemClick. Any thoughts on how I can be able to touch the webview and call OnListItemClick? Or is there something...

Can I add to an array adapter at run time

Hello, I finished the HelloSpinner tutorial and would like to try dynamically add more items into the spinner. I can understand the code for the array adapter, and i thought i could use the "adapter.add" method but it does not work. I have read another post that you cannot do that at run time, but what will be another option then? Thank...

Custom ArrayAdapter setBackground in getView

I'm working on a ListActivity which will display a bunch of numbers (weights). I would like to change the background of a specific row in the ListView. To do this I have created a custom implementation of the ArrayAdapter class and have overridden the getView method. The adapter accepts a list of numbers and sets the background of the ro...

notifyDataSetChanged() performance question and when/how to call in relation to a batch of data changes

I have ArrayList of custom objects that is the data underlying an ArrayAdapter for a ListView. Sometimes this data is modified in a batch, such as fetching a set of new items from the web. When the data is modified in a batch, should notifyDataSetChanged() be called after every add() to the ArrayList Some over simplified code: for(Ob...

How to change the color of the an item of a spinner's select list ?

Basicly i want to use first item as a "select one" message but i want it look different than other items on the select list. I am using getView but it is only changing the color when the item is selected.On the select list(when i click on the spinner to select an item) it does look same with others ! ...

Alternating styles on ListView using extended ArrayAdapter<E> random results

Currently my ListView is filling up with the given String[] but I wanted to alternate some styles on the ListView items. Something weird is happening (I'm surely missing something obvious); The ListView Index is not fixed and the styles are not alternating as supposed. My Code is the following: package com.blah.blah; import android.a...

Android: onItemClick only returns first selected Item

Hi. I'm using and ArrayAdapter to populate a ListView. After selecting and item, it displays a confirmation Y/N dialog. If the user's choice is negative, then he should be able to select another item showing the same dialog. And so on. Here's my code: lView.setOnItemClickListener(new OnItemClickListener() { public void onItemClic...