arrayadapter

ArrayAdapter and android:textFilterEnabled

I have created a layout which includes a ListView. The data shown within this ListView isn't too complicated, it's mostly an Array which is passed when the extended Activity is started. The rows themselves exist out of an icon and a text, thus an ImageView and a TextView. To fill up the ListView I use an ArrayAdapter simply because an ...

Why my button can trigger the UI to scroll and my TimerTask inside the activity can't?

Long Story Short: a method of my activity updates and scrolls the ListView through an ArrayAdapter like it should, but a method of an internal TimerTask for polling messages (which are displayed in the ListView) updates the ListView, but don't scroll it. Why? Long Story: I have a chat activity with this layout: <?xml version="1.0" enc...

Android - ListView with only 1 expandable item

I have a listview with tickboxes, which uses an Adapter and which works well. And I know how to make a whole list expandable. But, it it possible to have just a single item expandable, or does it have to be the whole list?? If so, how is it done? ...

ListView in ArrayAdapter order get's mixed up when scrolling

Hi, I have a ListView in a custom ArrayAdapter that displays an icon ImageView and a TextView in each row. When I make the list long enough to let you scroll through it, the order starts out right, but when I start to scroll down, some of the earlier entries start re-appearing. If I scroll back up, the old order changes. Doing this re...

How can I create a list with only certain items expandable?

I am trying to compose a list with some items expandable and some single items. I wish to have it so that when either a single item or expandable list child is clicked, I can call an intent based on the text of the item. I suppose expandable lists would work, but is there a way to set items in an expandable list so that they don't ha...

Fancy dynamic list in Android: TableLayout vs ListView

There is a requirement to have not-so-trivial dynamic list, each record of which consists of several columns (texts, buttons). It should look something like: Text11 Text12 Button1 Button2 Text21 Text22 Button1 Button2 ... At first obvious way to accomplish that seemed to be TableLayout. I was expecting to have layout/styling data spec...

Android: notifyDataSetChanged() not updating listview after orientation change

Hello all, I have a semi-complicated problem and hoping that someone here will be able to help me. On a click event I create a thread and start a long-running operation based on this method. After the long-running task is completed, it does a callback to another method, which does a post to the handler: @Override public void content...

android newbie question null pointer on ArrayAdapter.setAdapter

Hi All, I have been slowing learning and building my first android app. I'm VERY new to java but have already done a couple of projects in C#, VB.NET (back in the day), Objective-C (have 6 apps in the store) and Fortran (waaaaaaaaaaaaaaaaaaaay back in the day ;) So I just received from overseas a htc legend (I'm not in the US), which...

ListView with ArrayAdapter and ViewHolder adding icons to the wrong item.

I have a dynamic ListView which uses an ArrayAdapter. When a name is selected from a spinner, the name together with an icon showing whether they are male or female gets added to the ListView. Mostly everything is good (the name gets added to the list correctly, together with an icon). But the icon showing the sex gets added to the wron...

Android Change view properties of custom listview item on mouse down (duplicate default listview behavior)

I have a listview that displays a list of items of a custom resource. I have everything working, I can click on the listitem and I can call a toast or whatever I want to do. But how do I make it so I can change the color of the view's background when the user touches the item? I've tried doing the following and it works for a click, I ca...

[Android] Unable to modify ArrayAdapter in ListView

Hi there, I'm trying to make a list containing names. This list should be modifiable (add, delete, sort...). However, whenever I tried to change the items in the ArrayAdapter, the program crash, with java.lang.UnsupportedOperationException error. Here is my code: ListView panel = (ListView) findViewById(R.id.panel); String[] array = {"a...

Removing items from Android ListView/ArrayAdapter doesn't work after text filtering

I have an Android ListView, backed by an ArrayAdapter. When the user clicks on an item in the list, that item is removed. This all appears to work fine, you can click on each item until there are no items left. However, it all goes wrong once text filtering occurs. Once the list has been filtered once, even if that filter is cleared,...

Styling added rows to ArrayAdapter ListView Android

Hello, I have a ListView that I want to use with an ArrayAdapter to add different styled rows. The rows are created on different states in my application, and depending on the different states the rows should be styled(like colors and stuff). Here is some pseudo-code: on creation: mArrayAdapter = new ArrayAdapter(this, R.layout.messa...

Why won't my listview display?

I am trying to show a list of files using an ArrayAdapter into a ListView. As best as I can tell, the following should work but it is just leaving the ListView empty. I am not using a ListActivity. Java setContentView(R.layout.files); findViewById(R.id.folder_use).setOnClickListener(this); ListView view = (ListView)findViewById(R.id.fi...

Change a specific row in a ArrayAdapter ListView Android

Hi. I am trying to change the color on a specific row depending on different states. This is the code i have at the moment. public View getView(int position, View convertView, ViewGroup parent) { View row=convertView; if (row==null) { LayoutInflater inflater=getLayou...

how to pull strings from an array adapted listview for a clicked list item

ok so i have an array adapted listview (the array adapting is done in another class).. i just got the click listener working for the list but now i want set it up so that when i click an item it pulls the strings from the clicked item and piggybacks them on the intent to a new activity.. i figure im supposed to use intent.putextra howeve...

ListView Not Updating After Filtering

I have a ListView (with setTextFilterEnabled(true)) and a custom adapter (extends ArrayAdapter) which I update from the main UI thread whenever a new item is added/inserted. Everything works fine at first--new items show up in the list immediately. However this stops the moment I try to filter the list. Filtering works, but I do it once...

Adding onClick handler to View in list item

Hi, I have a ListActivity where the list items are defined in another XML layout. The list item layout contains an ImageView, a CheckBox, a TextView and such. What I want is to set an onClick listener to the CheckBox in each list item. That is easy enough. The trouble is I need that onClick handler to know which position in the list it...

Android how do I get the position of a row in an ListView from an onClickHandler()

I have a view that has a custom ArrayAdapter as a ListAdapter. Customer is a Poco: public class Customer { public String LastName; public boolean IsActive; } What works: I have sucesfully bound my ArrayList to my ListView, the LastName is displayed as a text and the CheckBox is checked or not (depending on IsActive) but now I ...

When Using the "Efficient Adapter", holder is sometimes null.

I'm using a mixture of the "Efficient Adapter" and the EndlessAdapter from CommonsGuy, and sometime the holder in getView() is null. @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = inflater.inflate(R.layout.queue_item, null); ...