@@ -0,0 +1,2366 @@
+package com.example.w0143446.anotherfragmenttest;%0A%0Aimport android.app.Activity;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0Aimport android.widget.ArrayAdapter;%0Aimport android.widget.ImageView;%0Aimport android.widget.ListAdapter;%0Aimport android.widget.TextView;%0A%0Aimport java.util.HashSet;%0Aimport java.util.Set;%0A%0Apublic class CustomListAdapter extends ArrayAdapter%3CString%3E implements ListAdapter%7B%0A    private final Activity context;%0A    private final String%5B%5D web;%0A    private final Integer%5B%5D imageId;%0A    private Set%3CString%3E viewedImgSet;%0A%0A    public CustomListAdapter(Activity context, String%5B%5D web, Integer%5B%5D imageId, HashSet%3CString%3E viewedImg) %7B%0A        super(context, R.layout.customlist_single, web);%0A        this.context = context;%0A        this.web = web;%0A        this.imageId = imageId;%0A        this.viewedImgSet = viewedImg;%0A%0A    %7D%0A    @Override%0A    public View getView(int position, View view, ViewGroup parent) %7B%0A        LayoutInflater inflater = context.getLayoutInflater();%0A        View rowView = inflater.inflate(R.layout.customlist_single, null, true);%0A        TextView txtTitle = (TextView) rowView.findViewById(R.id.txt);%0A        ImageView imageView = (ImageView) rowView.findViewById(R.id.img);%0A        txtTitle.setText(web%5Bposition%5D);%0A        imageView.setImageResource(imageId%5Bposition%5D);%0A        return rowView;%0A    %7D%0A%0A    @Override%0A    public boolean isEnabled(int position) %7B%0A        //System.out.println(%22my custom isEnabled button was triggered%22);%0A        if (viewedImgSet.contains(String.valueOf(position)))%7B%0A            return false;%0A        %7D%0A       else %7B%0A            return true;%0A        %7D%0A    %7D%0A%0A    public void setItemEnabled(int position, boolean enabled) %7B%0A        /*a custom function to toggle a particular%0A        list item to be enabled or disabled%0A        */%0A        String strPosition = String.valueOf(position);%0A        if (!enabled)%7B%0A            //set should take care of duplicates%0A            this.viewedImgSet.add(strPosition);%0A        %7D%0A        else %7B%0A            this.viewedImgSet.remove(strPosition);%0A        %7D%0A    %7D%0A    public Set%3CString%3E getImageSet()%7B%0A        /* Getter: Return the set of the images as a hashset%0A         used to put the values back in the settings%0A         */%0A%0A        System.out.println(%22Returned the Set%22);%0A        return this.viewedImgSet;%0A    %7D%0A%7D%0A%0A

Create CustomListAdapter.java