The error is because you defined a TextView inside a ListView. You
know ListView first is an AdapterView. You cannot add a view into
AdapterView because it is not supported. What you can do is to define
an Adapter(such as ArrayAdapter) then set the adapter into the
ListView. Hope this can help you.

On Aug 7, 12:57 pm, Shalin <[email protected]> wrote:
> Hello friend, when I am adding  editview in linearlayout I am getting
> an error like this. My XML file as under. I am trying to add editview
> above listview.
> Error is
> UnsupportedOperatioException: addView(View,LayoutParams) is not
> supported in adapterview.
>
> XMLfile:
> <ListView android:id="@+id/android:list"
>                android:layout_width="fill_parent"
>               android:layout_height="100dp"
>               android:background="#ffffff" android:layout_weight="3" >
> <TextView
>                 android:id="@+id/str"
>                 android:layout_width="fill_parent"
>                 android:layout_height="wrap_content"
>                 android:layout_weight="1"
>                 android:background="#ecff20">
>         </TextView>
>
>         <TextView
>                 android:id="@+id/count"
>                 android:layout_width="fill_parent"
>                 android:layout_height="wrap_content"
>                 android:layout_weight="1"
>                 android:background="#2f116f">
>         </TextView>
>
>         <LinearLayout  xmlns:android="http://schemas.android.com/apk/res/
> android"
>                 android:orientation="horizontal"
>                 android:layout_width="fill_parent"
>                 android:layout_height="wrap_content"
>         android:background="#cccccc"
>         android:textColor="#ffffff"
>         android:padding="3dp"
>         android:gravity="bottom"
>                 android:layout_weight="1"
>                 >
>             <EditText
>                 android:id="@+id/txt"
>                 android:layout_width="fill_parent"
>                 android:layout_height="fill_parent"
>                 android:background="@android:drawable/editbox_background"
>                 android:hint="Type to compose"
>                 android:minHeight="30dp"
>                 android:maxHeight="100dp"
>                 android:layout_weight="1"
>         />
>
>             <Button
>                 android:id="@+id/btn"
>                 android:layout_width="120dp"
>                 android:layout_height="fill_parent"
>                 android:layout_weight="1"
>                 android:text="Send SMS"
>             />
>         </LinearLayout>
>
> </LinearLayout>
>
> Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
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