[android-developers] Re: ArrayAdapter Vs BaseAdapter.

2013-03-01 Thread bob
I would just write your own class that implements the ListAdapter interface. It is not too bad, and I think it would be a good learning experience. On Thursday, February 28, 2013 11:50:24 PM UTC-6, Seshu wrote: Hi All, I want to show some students information i.e. id, name,

[android-developers] Re: ArrayAdapter Vs BaseAdapter.

2013-02-28 Thread skink
Seshu wrote: Hi All, I want to show some students information i.e. id, name, address and contact number in listview. Which Adapter should i use here i.e, ArrayAdapter or BaseAdapter. What's the major difference between them. Thanks and Regards, S.Seshu. for such data I would use

[android-developers] Re: ArrayAdapter not updating its ListView

2012-03-11 Thread scottishwildcat
For the record, since it's always good to post solutions (albeit three months later)... The only way I ever got this to work in the end was to use my own custom row layout and inflate that in getView(), rather than using android.R.layout.simple_list_item_multiple_choice. Everything worked just

[android-developers] Re: ArrayAdapter not updating its ListView

2011-11-24 Thread scottishwildcat
Hi Jon... thanks for the reply. Thought you might have been onto something there, as in fact I wasn't storing the ArrayList that was passed into the ShoppingListAdapter constructor at all -- I was just directly accessing the one in the parent class, as you said, although that does appear to be

[android-developers] Re: ArrayAdapter not updating its ListView

2011-11-24 Thread scottishwildcat
Hi Jon... thanks for the reply. Thought you might have been onto something there, as I wasn't storing the ArrayList that was passed into the ShoppingListAdapter constructor at all -- I was just directly accessing the one defined in the parent activity, as you noticed. So now my adapter

[android-developers] Re: ArrayAdapter not updating its ListView

2011-11-23 Thread JonFHancock
I've worked a lot with ArrayAdapters and ListView/GridView. I've never had a problem like you describe. It definitely isn't a fundamental flaw. Note that ListView recycles views, so that may be why you are getting the state of the checkbox transferred from one list item to the next. These

[android-developers] Re: ArrayAdapter craziness

2010-07-20 Thread metal mikey
Yeah, had similar problems in an ExpandableListAdapter when too much processing time was spent in overridden getChildView or getGroupView. So perhaps a solution to your problem is to minimise the amount of work being done in your getChildView function. On Jul 20, 4:01 pm, nwmotog...@gmail.com

[android-developers] Re: ArrayAdapter craziness

2010-07-20 Thread nation-x
Can you post your getView code? Are you using a holder? Shawn On Jul 20, 2:01 am, nwmotog...@gmail.com nwmotog...@gmail.com wrote: I am using a custom array adapter in my ListView.  It works fine when I am scrolling through a list of items slowly but when I attempt to scroll quickly the

Re: [android-developers] Re: ArrayAdapter use or misuse of the Adapter pattern

2010-02-25 Thread TreKing
On Wed, Feb 24, 2010 at 10:28 PM, Conny mcon...@gmail.com wrote: In a generalist sense adapter pattern is a bridge between 2 classes that have some common functionality, but the interfaces are not reusable between them. Ideally the need for adapter arises when we have two classes that are not

[android-developers] Re: ArrayAdapter use or misuse of the Adapter pattern

2010-02-25 Thread Conny
Agreed On Feb 25, 8:54 pm, TreKing treking...@gmail.com wrote: On Wed, Feb 24, 2010 at 10:28 PM, Conny mcon...@gmail.com wrote: In a generalist sense adapter pattern is a bridge between 2 classes that have some common functionality, but the interfaces are not reusable between them. Ideally

[android-developers] Re: ArrayAdapter use or misuse of the Adapter pattern

2010-02-24 Thread Conny
In a generalist sense adapter pattern is a bridge between 2 classes that have some common functionality, but the interfaces are not reusable between them. Ideally the need for adapter arises when we have two classes that are not developed keeping in mind interaction between them. Strategy

[android-developers] Re: ArrayAdapter also works with java.util.List (was Re: ListView with Streaming Content)

2009-10-22 Thread Streets Of Boston
You're right. Even better! :-) If you back just a simple java.util.List, then the ArrayAdapter will take care of most, if not all, of your requirements for a list-view. On Oct 21, 11:58 pm, Miguel Paraz mpa...@gmail.com wrote: Hi Marc and Streets of Boston, Thanks for the tips! As it turns

[android-developers] Re: ArrayAdapter / spinner help

2009-01-13 Thread android_soft
int MyNameColumn = c.getColumnIndexOrThrow(drawingName); c.moveToFirst(); if (c != null) { .} 1. You are checking for null after using it above twice which is redundant.. 2. Catch the exception 3. If catching and you are getting a NullPointer then use Lod.e(TAG,

[android-developers] Re: ArrayAdapter / spinner help

2009-01-13 Thread Josh Dobbs
That stops it from crashing but exception.getMessage() is null. Is there something i need to do so that the message is not null? What else should I be looking for? Thanks! Josh On Tue, Jan 13, 2009 at 7:22 AM, android_soft cspeche...@gmail.com wrote: int MyNameColumn =

[android-developers] Re: ArrayAdapter / spinner help

2009-01-13 Thread Josh Dobbs
I changed the code to read if (c != null) { . int MyNameColumn = c.getColumnIndexOrThrow(drawingName); c.moveToFirst(); } Im catching the exception which is java.lang.NullPointerException. I don't understand why tho. There is data in the array, i see it get filled when i step

[android-developers] Re: ArrayAdapter / spinner help

2009-01-13 Thread Josh Dobbs
I changed the code to just use the following array for testing purposes and i still get the null pointer exception. anyone have any ideas as to why? String[] array = {this, is, driving, me, crazy}; Spinner spinner_drawings = (Spinner) findViewById(R.id.spinner_drawings); ArrayAdapterString

[android-developers] Re: ArrayAdapter / spinner help

2009-01-13 Thread Mark Murphy
Josh Dobbs wrote: I changed the code to just use the following array for testing purposes and i still get the null pointer exception. anyone have any ideas as to why? String[] array = {this, is, driving, me, crazy}; Spinner spinner_drawings = (Spinner)

[android-developers] Re: ArrayAdapter / spinner help

2009-01-13 Thread Josh Dobbs
1. Have you called setContentView() before your call to findViewById()? 2. Does your layout have a Spinner element with android:id=@+id/spinner_drawings? Hi Mark, setContentView is called before i call findViewByid and the layout does have a spinner element with the proper name.

[android-developers] Re: ArrayAdapter / spinner help

2009-01-13 Thread Mark Murphy
Josh Dobbs wrote: 1. Have you called setContentView() before your call to findViewById()? 2. Does your layout have a Spinner element with android:id=@+id/spinner_drawings? Hi Mark, setContentView is called before i call findViewByid and the layout does have a spinner

[android-developers] Re: ArrayAdapter / spinner help

2009-01-13 Thread Josh Dobbs
THANK YOU after reading this... If the NullPointerException is exactly on the statement you pointed out, then spinner_drawings must be null, suggesting something is going wrong with the loading of your layout. and looking at my code again i realized that findViewById() should read

[android-developers] Re: ArrayAdapter / spinner help

2009-01-12 Thread Josh
This is still eluding me. here is the log. 01-12 22:53:58.836: DEBUG/AndroidRuntime(446): Shutting down VM 01-12 22:53:58.836: WARN/dalvikvm(446): threadid=3: thread exiting with uncaught exception (group=0x40010e28) 01-12 22:53:58.912: ERROR/AndroidRuntime(446): Uncaught handler: thread main

[android-developers] Re: ArrayAdapter

2008-10-30 Thread Biosopher
I used notifyDataSetChanged() and it works fine for me. Here's my complete code with the notifyDataSetChanged() at the bottom in the selection listener: package com.pocketjourney.location.map; import java.util.List; import android.content.Context; import android.view.LayoutInflater; import

[android-developers] Re: ArrayAdapter

2008-10-30 Thread Emery
You're doing it onItemClick, so it's probably invalidated for redraw anyway. In my case the items are coming in on a separate thread. If I was to click an item it would update then. But of course that's a very weird interaction to touch the screen and suddenly all of the updates show up at once.

[android-developers] Re: ArrayAdapter

2008-10-30 Thread yasmin afrose
Hi, Can any one help me to get the concept of ListView? I would like to display list of video's link in my xml. Could you please tell me how can I achieve this requirements? If I clicks any one of videos within the list of videos then it will display the corresponding video in the same

[android-developers] Re: ArrayAdapter

2008-10-29 Thread tauntz
Try notifyDataSetChanged() - it has no documentation but it seems to do what you want. Tauno On Tue, Oct 28, 2008 at 9:21 PM, Emery [EMAIL PROTECTED] wrote: How does the ArrayAdapter know when the array has been modified? I am using my own adapter, and I want to add items as they come in

[android-developers] Re: ArrayAdapter

2008-10-29 Thread Emery
I implemented the async incoming data on a separate thread which adds the items to a Vector that is connected to the view through my custom adapter (inherits BaseAdapter). When new items come in the list does not update, unless I scroll it with my finger to signal a redraw. I tried lots of