Listview with multiple checkbox and image View?

≡放荡痞女 提交于 2019-12-02 10:22:48
Vineet Shukla

Here is your architecture for your need:

  1. Get the installed application list.
  2. Implement a custom list adapter.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!