Listview with multiple select check box
<p>I am facing some problem, I have a button on click of the button it should go to second activity which consist of listview with checkboxs, I can select any number of items in the list,after selecting I should get back selected items in an edit box in the main activity.</p>

<p>Thank u.</p>

<p>public class MainActivity extends AppCompatActivity {</p>

<pre><code>private ListView llChb;
Button save;

private String[] data = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
        "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w",
        "x", "y", "z" };
private ArrayList&lt;String&gt; arrData=null;

private ArrayList&lt;InfoRowdata&gt; infodata;


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    save= (Button) findViewById(R.id.button_save);
    save.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

        }
    });

          llChb = (ListView) findViewById(R.id.llChb);

    infodata = new ArrayList&lt;InfoRowdata&gt;();
    for (int i = 0; i &lt; data.length; i++) {
        infodata.add(new InfoRowdata(false, i));
        // System.out.println(i);
        //System.out.println("Data is == "+data[i]);
    }
    llChb.invalidate();
    llChb.setAdapter(new MyAdapter());
}
public class MyAdapter extends BaseAdapter {

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

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

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

    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub
        View row = null;
        row = View.inflate(getApplicationContext(), R.layout.rowxml, null);
        TextView tvContent=(TextView) row.findViewById(R.id.tvContent);
        //tvContent.setText(data[position]);
        tvContent.setText(data[position]);
        //System.out.println("The Text is here like.. == "+tvContent.getText().toString());

        final CheckBox cb = (CheckBox) row
                .findViewById(R.id.chbContent);
        cb.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                if (infodata.get(position).isclicked) {
                    infodata.get(position).isclicked = false;
                } else {
                    infodata.get(position).isclicked = true;
                }

                for(int i=0;i&lt;infodata.size();i++)
                {
                    if (infodata.get(i).isclicked)
                    {
                        System.out.println("Selectes Are == "+ data[i]);
                    }
                }
            }
        });

        if (infodata.get(position).isclicked) {

            cb.setChecked(true);
        }
        else {
            cb.setChecked(false);
        }
        return row;


    }

}
</code></pre>

<p>The above code is my second activity.</p>