On Wed, Sep 29, 2010 at 4:52 PM, Varun Khanduja <[email protected]>wrote:
> Still I don't think it's working for me, can someone suggest me where I am
> going wrong?
>
You're not creating custom adapters, you just have four regular
ArrayAdapters (with the same data, it looks like).
You need something like:
class MyAdapter : ArrayAdapter<MyObjectType>
{
@Override
public View getView(int i, View v, ViewGroup vg)
{
switch (state)
{
case 1:
return createViewType1();
case 2:
return createViewType2();
case 3:
return createViewType3();
case 4:
return createViewType4();
}
}
Then, in your class:
setAdapter(new MyAdapter());
Then when you click your buttons you set "state" and implement the
"createView" functions to return the view you need in your ListView for that
given state. Or something. That's just one idea to get your rolling.
-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en