i want select all checkBox when click on "selectAll" button.i have custom list view with checkBox and textView. below i put my code and screen shot for reference.
activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >
        <ListView
            android:id="@+id/lvMain"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />
            <Button
                android:id="@+id/btnSelectAll"
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:text="Select All" >
            </Button>
        </LinearLayout>
list_item.xml
 <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal" >
        <CheckBox
            android:id="@+id/cbItem"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:buttonTint="#000000">
        </CheckBox>
        <TextView
            android:id="@+id/tvItem"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#000000">
        </TextView>
    </LinearLayout>
MainActivity.java
public class MainActivity extends Activity {
ListView lvMain;
String[] name = { "Jenis", "Pratik", "Jaydeep", "Hiren", "Himansu",
        "yagnik", "Atul", "Prakas", "Nihal", "Darshan", "Chetan", "Sagar",
        "Nikhil", "Sanket", "Rahul", "Jigar" };
Button btnSelectAll;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    lvMain = (ListView) findViewById(R.id.lvMain);
    btnSelectAll = (Button) findViewById(R.id.btnSelectAll);
    ListAdapter adapter = new ListAdapter(getApplicationContext(), name);
    lvMain.setAdapter(adapter);
    adapter.notifyDataSetChanged();
}
}
ListAdapter.java
package com.example.checkallcheckbox;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.TextView;
public class ListAdapter extends BaseAdapter {
    Context mContext;
    String[] name;
    private static LayoutInflater inflater = null;
    public ListAdapter(Context c, String[] name) {
        // TODO Auto-generated constructor stub
        mContext = c;
        this.name = name;
        inflater = (LayoutInflater) mContext
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }
    @Override
    public int getCount() {
        return name.length;
    }
    @Override
    public Object getItem(int position) {
        // TODO Auto-generated method stub
        return position;
    }
    @Override
    public long getItemId(int position) {
        // TODO Auto-generated method stub
        return position;
    }
    public class ViewHolder {
        TextView tvName;
        CheckBox cbName;
    }
    @Override
    public View getView(int position, View convertView, ViewGroup arg2) {
        // TODO Auto-generated method stub
        ViewHolder viewHolder;
        if (convertView == null) {
            convertView = inflater.inflate(R.layout.list_item, null);
            viewHolder = new ViewHolder();
            viewHolder.tvName = (TextView) convertView
                    .findViewById(R.id.tvItem);
            viewHolder.cbName = (CheckBox) convertView
                    .findViewById(R.id.cbItem);
            convertView.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) convertView.getTag();
        }
        viewHolder.tvName.setText(name[position]);
        return convertView;
    }
}