On Thu, Mar 18, 2010 at 10:47 AM, social hub <[email protected]> wrote:
> Hi,
>
> I have a case where I have add to listview textview based on no of
> messages.
>
> 1)
> I am doing like this
> for(int i=0;i<10;i++)
> {
> TextView tv=new TextView(context);
> linearlayout.add(tv);
> }
>
Which is it, listview or linearlayout?
> I really like to know is there a better way to do than this way. is there a
> way to clone a textview and reuse it rather than inflating every time
>
If you really want a list of items, you should be using a ListView, for
which you can define an adapter that provides you with an existing View, if
available, that you can reuse in the list instead of creating a new one each
time.
-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking
--
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