@@ -0,0 +1,2058 @@
+package com.nbusy.app;%0A%0Aimport android.content.Context;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0Aimport android.widget.ArrayAdapter;%0Aimport android.widget.TextView;%0A%0Aimport java.util.List;%0A%0Apublic class ChatListArrayAdapter extends ArrayAdapter%3CChats.Chat%3E %7B%0A%0A    public ChatListArrayAdapter(Context context, List%3CChats.Chat%3E values) %7B%0A        super(context, R.layout.chat_list_row, values);%0A    %7D%0A%0A    @Override%0A    public View getView(int position, View convertView, ViewGroup parent) %7B%0A        Chats.Chat chat = getItem(position);%0A%0A        // check if an existing view is being reused, otherwise inflate the view%0A        ViewHolder viewHolder; // view lookup cache stored in tag%0A        if (convertView == null) %7B%0A            viewHolder = new ViewHolder();%0A            LayoutInflater inflater = LayoutInflater.from(getContext());%0A            convertView = inflater.inflate(R.layout.chat_list_row, parent, false);%0A            viewHolder.contactName = (TextView) convertView.findViewById(R.id.contact_name);%0A            viewHolder.lastMessage = (TextView) convertView.findViewById(R.id.last_message);%0A            viewHolder.sent = (TextView) convertView.findViewById(R.id.sent);%0A            convertView.setTag(viewHolder);%0A        %7D else %7B%0A            viewHolder = (ViewHolder) convertView.getTag();%0A        %7D%0A%0A        viewHolder.contactName.setText(chat.name);%0A        viewHolder.lastMessage.setText(chat.message);%0A        viewHolder.sent.setText(chat.sent);%0A%0A        // change the icon for Windows and iPhone%0A//        ImageView imageView = (ImageView) rowView.findViewById(R.id.icon);%0A//        String s = objects%5Bposition%5D;%0A//        if (s.startsWith(%22iPhone%22)) %7B%0A//            imageView.setImageResource(R.drawable.no);%0A//        %7D else %7B%0A//            imageView.setImageResource(R.drawable.ok);%0A//        %7D%0A%0A        return convertView;%0A    %7D%0A%0A    // view holder pattern template%0A    static class ViewHolder %7B%0A        TextView contactName;%0A        TextView lastMessage;%0A        TextView sent;%0A    %7D%0A%7D

add ChatListArrayAdapter