There is such an adapter. do in activi
mAdapter.clear(); mAdapter.notifyDataSetChanged(); Just nothing happens.
Adapter code:
public class FilesAdapter extends ArrayAdapter<FilesInfo> { private ArrayList<FilesInfo> mObjects; private Context mContext; private View mConvertView; private ViewGroup mParent; public FilesAdapter(Context _context, ArrayList<FilesInfo> _objects) { super(_context, R.layout.c_files_list_view); mContext = _context; mObjects = _objects; } @Override public int getCount() { return mObjects.size(); } @Override public View getView(int _position, View _convertView, ViewGroup _parent) { LayoutInflater mInflater = (LayoutInflater) mContext .getSystemService(Context.LAYOUT_INFLATER_SERVICE); mConvertView = _convertView; mParent = _parent; if (mConvertView == null) { mConvertView = mInflater.inflate(R.layout.c_files_list_view, mParent, false); } ((ImageView) mConvertView.findViewById(R.id.list_icon)).setImageDrawable(mObjects.get(_position).getIcon()); ((TextView) mConvertView.findViewById(R.id.list_name)).setText(mObjects.get(_position).getName()); ((TextView) mConvertView.findViewById(R.id.list_size)).setText(Double.toString(mObjects.get(_position).getSize())); return mConvertView; }
ArrayList<FilesInfo> _objects, notAdapter- tim_taller