I am going to create an application for displaying the installed applications (and their icons) in a listview which will contain multiple checkboxes. How can I do this? If it\'s
Here is your architecture for your need:
You can refer to this tutorial too.
Your xml for custom list adapter will be like this:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width = "fill_parent"
android:layout_height = "wrap_content"
android:padding = "10dp" >
<ImageView
android:id = "@+id/image_icon"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:layout_alignParentLeft = "true" />
<TextView
android:id = "@+id/txt_name"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:textSize = "15dp"
android:textColor = "@color/white"
android:layout_toRightOf = "@+id/image_icon"
android:layout_marginLeft = "8dp"
android:maxLength = "20"
android:ellipsize = "marquee" />
<CheckBox
android:id = "@+id/item_check"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:layout_alignParentRight = "true"
android:button = "@drawable/btn_checkbox_selector"
android:layout_marginRight = "10dp"
android:clickable = "true" />
</RelativeLayout>
Here is the link with that you can bind checkbox and its stats. http://www.androidsnippets.com/clickable-listview-items Also you can handle click events for each of the view items added to listview.