Ivan Soto wrote:
> Hello,
> 
> I'm having the following problem.
> I'm trying to populate a ListView with the following:
>                 twText = (ListView) findViewById(R.id.list_items);
>                 ArrayAdapter<String> twText_list = new
> ArrayAdapter<String>(this, R.layout.list_item, R.id.row_text2,
> tw_text);      
>                 twText.setAdapter(twText_list);
> 
> and the list_item.xml is this one:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
>     android:layout_width="fill_parent"
>     android:layout_height="wrap_content">
>     <TextView android:id="@+id/row_text2"
>         android:textAppearance="?android:attr/textAppearanceSmall"
>         android:layout_width="fill_parent"
>         android:layout_height="fill_parent"
>         />
> </LinearLayout>
> 
> 
> That works perfectly, but once I add an ImageView it crashes:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
>     android:layout_width="fill_parent"
>     android:layout_height="wrap_content">
>     <imageView android:id="@+id/profile_image_url"
>         android:maxWidth="50px"
>         android:maxHeight="20px"
>          />
>     <TextView android:id="@+id/row_text2"
>         android:textAppearance="?android:attr/textAppearanceSmall"
>         android:layout_width="fill_parent"
>         android:layout_height="fill_parent"
>         />
> </LinearLayout>

Try a capital I in ImageView. These are class names, and Android follows
the general Java convention of CamelCaseClassNames.

If that doesn't clear up the problem, can you post the exception? You
will find it using adb logcat, DDMS, or the Eclipse equivalent.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to