RE: [android-developers] Implementing TwoLineListItem

2012-06-14 Thread Bernard FitzGerald

Thanks for the that. I'd googled around (a lot) until I found a good way of 
implementing it. Found a solution here 
http://beginnerdroid.wordpress.com/ 
It was all in the detail as they say. I just had to create a customised 
ArrayAdapter and I was fine.
Thanks!

From: magouyaw...@gmail.com
Date: Thu, 14 Jun 2012 11:13:18 -0600
Subject: Re: [android-developers] Implementing TwoLineListItem
To: android-developers@googlegroups.com


Does anyone have any sample code of how to implement a

TwoLineListItem.

http://lmgtfy.com/?q=android+TwoLineListItem+tutorial



So far I have been able to create a custom LinearLayout with two

TextViews and have gotten this working but I believe I should be using

a TwoLineListItem to acheive this. My issue is that I can't seem to

implement the TwoLineListItem.

If you've got something working then I wouldn't worry about it.  "If it ain't 
broke, don't fix it." :-)  That being said, if you are really dead set on using 
it, then look at the link above...



myAdapter.notifyDataSetChanged();
setListAdapter(myAdapter);

I may be wrong, but I believe you need to set your adapter before calling 
notifyDataSetChanged()



Thanks,

Justin Anderson

MagouyaWare Developer

http://sites.google.com/site/magouyaware



On Tue, Jun 12, 2012 at 5:41 PM, Bernard FitzGerald  
wrote:


Hi all,



Does anyone have any sample code of how to implement a

TwoLineListItem.



So far I have been able to create a custom LinearLayout with two

TextViews and have gotten this working but I believe I should be using

a TwoLineListItem to acheive this. My issue is that I can't seem to

implement the TwoLineListItem.



In my main layout I add a ListView and then I also create another

layout xml file named list_item that contains a linearlayout with a

twolinelistitem.



In my java class I add items to a list of a HashMap. I

create a SimpleAdapter as follows:



SimpleAdapter myAdapter = SimpleAdapter(this, list,

R.layout.list_item_new, new String[] { "line1", "line2" }, new int[]

{ R.id.text1, R.id.text2 });



Then:



myAdapter.notifyDataSetChanged();

setListAdapter(myAdapter);



I would of thought that this would populate my list but no. Can anyone

help me with this?



Thanks, Bernie.









--

You received this message because you are subscribed to the Google

Groups "Android Developers" group.

To post to this group, send email to android-developers@googlegroups.com

To unsubscribe from this group, send email to

android-developers+unsubscr...@googlegroups.com

For more options, visit this group at

http://groups.google.com/group/android-developers?hl=en




-- 

You received this message because you are subscribed to the Google

Groups "Android Developers" group.

To post to this group, send email to android-developers@googlegroups.com

To unsubscribe from this group, send email to

android-developers+unsubscr...@googlegroups.com

For more options, visit this group at

http://groups.google.com/group/android-developers?hl=en 
  

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Implementing TwoLineListItem

2012-06-14 Thread Justin Anderson
>
> Does anyone have any sample code of how to implement a
> TwoLineListItem.
>

http://lmgtfy.com/?q=android+TwoLineListItem+tutorial

So far I have been able to create a custom LinearLayout with two
> TextViews and have gotten this working but I believe I should be using
> a TwoLineListItem to acheive this. My issue is that I can't seem to
> implement the TwoLineListItem.
>

If you've got something working then I wouldn't worry about it.  "If it
ain't broke, don't fix it." :-)  That being said, if you are really dead
set on using it, then look at the link above...

myAdapter.notifyDataSetChanged();
> setListAdapter(myAdapter);
>

I may be wrong, but I believe you need to set your adapter before calling
notifyDataSetChanged()

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Tue, Jun 12, 2012 at 5:41 PM, Bernard FitzGerald wrote:

> Hi all,
>
> Does anyone have any sample code of how to implement a
> TwoLineListItem.
>
> So far I have been able to create a custom LinearLayout with two
> TextViews and have gotten this working but I believe I should be using
> a TwoLineListItem to acheive this. My issue is that I can't seem to
> implement the TwoLineListItem.
>
> In my main layout I add a ListView and then I also create another
> layout xml file named list_item that contains a linearlayout with a
> twolinelistitem.
>
> In my java class I add items to a list of a HashMap. I
> create a SimpleAdapter as follows:
>
> SimpleAdapter myAdapter = SimpleAdapter(this, list,
> R.layout.list_item_new, new String[] { "line1", "line2" }, new int[]
> { R.id.text1, R.id.text2 });
>
> Then:
>
> myAdapter.notifyDataSetChanged();
> setListAdapter(myAdapter);
>
> I would of thought that this would populate my list but no. Can anyone
> help me with this?
>
> Thanks, Bernie.
>
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Implementing TwoLineListItem

2012-06-14 Thread Bernard FitzGerald
Hi all,

Does anyone have any sample code of how to implement a
TwoLineListItem.

So far I have been able to create a custom LinearLayout with two
TextViews and have gotten this working but I believe I should be using
a TwoLineListItem to acheive this. My issue is that I can't seem to
implement the TwoLineListItem.

In my main layout I add a ListView and then I also create another
layout xml file named list_item that contains a linearlayout with a
twolinelistitem.

In my java class I add items to a list of a HashMap. I
create a SimpleAdapter as follows:

SimpleAdapter myAdapter = SimpleAdapter(this, list,
R.layout.list_item_new, new String[] { "line1", "line2" }, new int[]
{ R.id.text1, R.id.text2 });

Then:

myAdapter.notifyDataSetChanged();
setListAdapter(myAdapter);

I would of thought that this would populate my list but no. Can anyone
help me with this?

Thanks, Bernie.




-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en