Getting variable form custom adapter in another Class
<p>Im capturing click events on Checkboxes inside my ListView that the Adapter builds and building anArrayList that I need to use in the view that initiated the ListView</p>

<p><strong>HiddenChannelsListAdapter.java</strong></p>

<p>This is my customAdapater part in getView()</p>

<pre><code>public class HiddenChannelsListAdapter extends BaseAdapter {
     public ArrayList&lt;String&gt; slist;


CheckBox checkbox = (CheckBox) convertView.findViewById(R.id.check_channel);
        checkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
            {

                if ( isChecked ) {
                    if ( !slist.contains(i.get("id")) )
                    slist.add(i.get("id"));
                } else {
                    for (int j=0;j&lt;slist.size();j++) {
                        if ( slist.get(j) == i.get("id") ) {
                            slist.remove(j);
                        }
                    }       
                }
            }           
        });
</code></pre>

<p>Now in my class ChannelsDialogPreference.java :</p>

<pre><code> @Override
    public void onClick (DialogInterface dialog, int which)
    {
        super.onClick(dialog, which);
        if(which == -1) {
           **here I need that slist ArrayList**
        }
    }
</code></pre>
