[android-developers] Re: How to create a simple list of names, with personal image for each row

2009-05-29 Thread Morelli Giuseppe

Thank you Vincent, I've read the link you sent, and it was opening my
mind. Now I've solved the problem inheriting from BaseAdapter. There
are also some methods to ovverride, and the most important is getView
for callback.  Then I created a simple class that inherit from
LynearLayout, to define the layout of each row. So I solved the
problem.

The trouble I have right now, is simpler in my opinion. I've decided
to delegate the loading of data from network to a thread class, that
is started in the main activity with thread.start() passing to it's
constructor the inherited BaseAdapter class, making the thread able to
modify the list itself.
Before launching the new thread the activity starts a ProgressDialog
with pd = ProgressDialog.show(...params...); when the thread ends, it
requests the stop of the ProgressDialog sending a signal to an handler
made for this aim in this way: handler.sendEmptyMessage(0).
Now you will ask: where is the problem?

Well, the problem is that when the thread ends nothing is displayed on
the screen, but the data are there!! The strange thing is that when I
use the Hierarchy Viewer, clicking on the Load View Hierarchy
button, the screen render the list!!!

Can someone help me?? Thank you guys!
--~--~-~--~~~---~--~~
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] Re: How to create a simple list of names, with personal image for each row

2009-05-21 Thread Vincent Tsao
hi, this sample tutorial may help you
http://stackoverflow.com/questions/459729/how-to-display-list-of-images-in-listview-in-android/892643#892643

On Thu, May 21, 2009 at 11:36 PM, Morelli Giuseppe
peppe.more...@gmail.comwrote:


 Hi guys,
 I'm trying to create a simple list for my app extending the
 ListActivity Class.
 All names the names I want to display are stored in an ArrayList, and
 I use ArrayAdapter to link each element of the array with a row in the
 list view. This is the code to instatiate the ArrayAdapter:

 ArrayList listItems = new ArrayListString();
 ArrayAdapter aa = new ArrayAdapterString(this, R.layout.singlerow,
 listItems);

 where R.layout.singlerow is:

 ?xml version=1.0 encoding=utf-8?

 TextView android:id=@+id/textInfo
xmlns:android=http://schemas.android.com/apk/res/android;
android:layout_width=fill_parent
 android:layout_height=wrap_content
 /TextView

 and my main.xml is:

 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
android:id=@+id/mainLinearLayout
 android:layout_width=fill_parent
android:layout_height=wrap_content android:padding=10px
ListView android:id=@android:id/list
 android:orientation=horizontal
android:layout_width=fill_parent
 android:layout_height=fill_parent
/ListView

 /LinearLayout

 Now my problem is: how can I add an image for each item in the list?
 I've tried a lot of solution, but all are not working. Please help me,
 I'm becoming craz!

 Thank you guys.

 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---