0

I have linearlayers, with two textview, and checkkbox. I want create custom view, and add this code few times. I try 2 days, create custom view, but i don't find example with more complicated sample. Only one textview, or other simple thing.

My linearlayer:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content"    
android:background="@drawable/border1px" 
android:focusable="true"
android:clickable="true"    
android:id="@+id/linearxyz" 
>

<RelativeLayout android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_marginLeft="15dip"
android:focusable="false"
android:clickable="false"
>

<TextView android:id="@+android:id/title"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="Testxyz"
android:textColor="#FF0000" 
/>

<TextView android:id="@+android:id/summary"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="Testxyz2"
/>
</RelativeLayout>

<CheckBox 
android:id="@+android:id/checkboxxyz" 
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>

</LinearLayout>

I want, use this layer, and i want change the text of textview, change id layer and add onclicklistener, to him.

chiken
  • 31
  • 1
  • 5
  • Why don't you directly use a `RelativeLayout` and move your controls wherever you want them on the Layout? Or do you specifically need nested layouts? – Cosmin Ionascu Jul 30 '13 at 12:33
  • This code, is listview with checkbox. But i use sherlockfragment and i can't use preference. I want have few setting, with checkbox. And i don't want add this in normal layout. I want automatic this. Can you help me? – chiken Jul 30 '13 at 17:10
  • Well if you need a listview that has checkboxes you should check out this [link](http://stackoverflow.com/questions/1505751/android-binding-data-from-a-database-to-a-checkbox-in-a-listview) – Cosmin Ionascu Jul 31 '13 at 07:07

1 Answers1

0

i use listview, with adapter, it's working very good. Thanks for your help

I use http://javatechig.com/android/android-listview-tutorial/, and i modify to my own program.

chiken
  • 31
  • 1
  • 5