implementing Listview with custom adapter in Widget
<p>I just started Android programming and I am not familiar with Widgets yet, I require your help and advice. Currently I have completed my Timetable Application that uses a custom Array Adapter to read data from an XML format file returned from the web service. I will then set the Listview's adapter to that of the custom ArrayAdapter. </p>

<p>The situation now is that I cannot find any guides or solution in implementing my custom adapter in the widget.</p>

<p>TimetableAdapter.java</p>

<pre><code>public class TimetableAdapter extends ArrayAdapter&lt;ModuleDetails&gt; {
    private ArrayList&lt;ModuleDetails&gt; entries;
    private Context context;

    public TimetableAdapter(Context c, int textViewResourceId,
            ArrayList&lt;ModuleDetails&gt; entries) {
        super(c, textViewResourceId, entries);
        this.entries = entries;
        this.context = c;
    }

    public static class ViewHolder {
        public TextView item1;
        public TextView item2;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        View v = convertView;
        ViewHolder holder;
        if (v == null) {
            LayoutInflater vi = (LayoutInflater) context
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.timetablerows, null);
            holder = new ViewHolder();
            holder.item1 = (TextView) v.findViewById(R.id.timetableTime);
            holder.item2 = (TextView) v.findViewById(R.id.timetableName);
            v.setTag(holder);
        } else
            holder = (ViewHolder) v.getTag();

        final ModuleDetails details = entries.get(position);
        String moduleTime = details.getStartTime() + "-" + details.getEndTime();
        String moduleName = details.getModuleCode() + "-" + details.getModuleName();

        holder.item1.setText(moduleTime);
        holder.item2.setText(moduleName);



        return v;
    }

}
</code></pre>
