getting checked item from listview connected with override base adapter android
<p>I want to get the checked items list in a String array.
i have taken a videoList as a listview and i have implemented base adapter with it and override baseadapter and customized it with checkbox.<br>
i have tried this but its giving nullpointerexception.</p>

<pre><code>btnplay.setOnClickListener(new View.OnClickListener() 
    {
        SparseBooleanArray sparseBooleanArray = videolist.getCheckedItemPositions();

        @Override
        public void onClick(View v)
        {

            for(int i =0 ; i&lt;videolist.getCount();i++)
            {

                if(sparseBooleanArray.get(i))
                {

                    String str = (String) videolist.getItemAtPosition(sparseBooleanArray.keyAt(i));
                    Toast.makeText(getBaseContext(),str , 3).show();
                }
            }


        }
    });


public class VideoAdapter extends BaseAdapter
{
    private Context vContext;
    public VideoAdapter(Context c) 
    {
        vContext = c;
    }

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

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

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

    @Override
    public View getView(int position, View convertView, ViewGroup parent) 
    {

        System.gc();
        LayoutInflater inflater = (LayoutInflater) vContext.getSystemService(vContext.LAYOUT_INFLATER_SERVICE);
        View view;
        CheckBox cb;
                String id = null;
        if (convertView == null) 
        {
            view = new View(vContext);  

            view = inflater.inflate(R.layout.row, null);

            cb = (CheckBox) view.findViewById(R.id.checkBox1);


            video_column_index = videocursor.getColumnIndexOrThrow(MediaStore.Video.Media._ID);

            videocursor.moveToPosition(position);


            video_column_index = videocursor.getColumnIndexOrThrow(MediaStore.Video.Media.DISPLAY_NAME);

            videocursor.moveToPosition(position);

            id = videocursor.getString(video_column_index);

            video_column_index = videocursor.getColumnIndexOrThrow(MediaStore.Video.Media.SIZE);

            videocursor.moveToPosition(position);

            id += " Size(KB):" + videocursor.getString(video_column_index);

            cb.setText(id);
        } else
              view = convertView;
        return view;
}
</code></pre>
