Q:

How do I get all the selected list Items using Checkbox

I am using Checkbox with each and every list item, and now i would like to get name of all the selected list items on button click.
I have posted code of Adapter and Activity class as well, because later i have to show selected list items into another activity into ListView.
But for now i just want to see all the selected list items on button click
Adapter:
    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
        // convert view = design
        ....................

        holder.tvName.setText(actorList.get(position).getName());           

        holder.checkBox.setOnCheckedChangeListener(null);

        holder.checkBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if(isChecked){
                    // add into arraylist
                  selectedname.add(actorList.get(position).getName());
                }else{
                    // remove from arraylist
                    selectedname.remove(actorList.get(position).getName());
                }

            }
        });

        return v;

    }   

A:

The below code working fine for me so you can try this
activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/select_btn"
    android:text="Select"/>

<ListView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/listview"/>

list_row.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="4dp"
android:orientation="horizontal" >

<CheckBox
    android:id="@+id/cbBox"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical" >
</CheckBox>

<TextView
    android:layout_height="wrap_content"
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_gravity="center_vertical"
    android:ellipsize="marquee" />

Service
import java.io.Serializable;
public class Service implements Serializable
{

private static final long serialVersionUID = 1L;

private String name;
private boolean selected;

public Service() {
    // TODO Auto-generated constructor stub
}

public Service(String name) {
    super();
    this.name = name;
}

public String getName() {
    return name;
}

public boolean isSelected() {
    return selected;
}

public void setSelected(boolean selected) {
    this.selected = selected;
}

public void setName(String name) {
    this.name = name;

}

}
ServiceAdapter
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
public class ServiceAdapter extends BaseAdapter {
ArrayList<Service> actorList;
LayoutInflater vi;
Context context;

public ServiceAdapter(Context context,ArrayList<Service> objects) {
    this.context= context;
    this.vi = (LayoutInflater) context
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    this.actorList = objects;
}

@Override
public View getView(final int position, View convertView, ViewGroup parent) {
    // convert view = design
    final ViewHolder holder;
    if (convertView == null) {
        holder = new ViewHolder();
        convertView = vi.inflate(R.layout.list_row, null);

        holder.tvName = (TextView) convertView.findViewById(R.id.textView1);
        holder.checkBox = (CheckBox) convertView.findViewById(R.id.cbBox);

        convertView.setTag(holder);
    } else
        holder = (ViewHolder) convertView.getTag();

    holder.tvName.setText(actorList.get(position).getName());
    holder.checkBox.setChecked(actorList.get(position).isSelected());

    holder.checkBox.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            boolean isSelected = ((CheckBox)v).isChecked();
            actorList.get(position).setSelected(isSelected);
        }
    });

    return convertView;

}

static class ViewHolder {

    public TextView tvName;
    public CheckBox checkBox;

}

@Override
public int getCount() {
    // TODO Auto-generated method stub
    return actorList.size();
}

@Override
public Object getItem(int position) {
    // TODO Auto-generated method stub
    return actorList.get(position);
}

@Override
public long getItemId(int position) {
    // TODO Auto-generated method stub
    return position;
}

public ArrayList<Service> getSelectActorList(){
    ArrayList<Service> list = new ArrayList<>();
    for(int i=0;i<actorList.size();i++){
        if(actorList.get(i).isSelected())
            list.add(actorList.get(i));
    }
    return list;
}

}
MainActivity
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Toast;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {

private ListView listView;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    final ListView listView = (ListView)findViewById(R.id.listview);
    listView.setAdapter(new ServiceAdapter(this,sampleData()));

    Button btn = (Button)findViewById(R.id.select_btn);
    btn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            ArrayList<Service> actorList = ((ServiceAdapter)listView.getAdapter()).getSelectActorList();
            Toast.makeText(MainActivity.this,""+actorList.size(),Toast.LENGTH_LONG).show();
        }
    });

}

public ArrayList<Service> sampleData(){
    ArrayList<Service> dataList = new ArrayList<>();
    for(int i=0;i<30;i++){
        Service servic = new Service();
        servic.setName("Test"+i);
        dataList.add(servic);
    }

    return dataList;
}

}

A:

This may helps you.
ArrayList<String> selectedname  = new ArrayList<String>();

@Override
    public View getView(final int position, View convertView, ViewGroup parent) {
        // convert view = design
        View v = convertView;
        if (v == null) {
            holder = new ViewHolder();
            v = vi.inflate(Resource, null);

            holder.tvName = (TextView) v.findViewById(R.id.textView1);          
            holder.checkBox = (CheckBox) v.findViewById(R.id.cbBox);

            v.setTag(holder);
        } else {
            holder = (ViewHolder) v.getTag();
        }

        holder.tvName.setText(actorList.get(position).getName());  
       checkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if(isChecked){
                    // add into arraylist
                  selectedname.add(actorList.get(position).getName());
                }else{
                    // remove from arraylist
                    selectedname.remove(actorList.get(position).getName());
                }

            }
        });

        return v;

    }

    static class ViewHolder {

        public TextView tvName; 
        public CheckBox checkBox;

    }

pass this selected selectedname List to another activity. on Button Click pass List between Activity like

