You can configure your adapter. But I think your idea is SET MAX ITEM OF LIST VIEW. (I think it will be better).
So, you will configure your adapter as follows:
private class CustomAdapter<T> extends ArrayAdapter<T> { private static final int MAX_ROW_DISPLAY = 5; private List<T> mItems; public CustomAdapter(Context context, int resource, List<T> objects) { super(context, resource, objects); mItems = objects; } @Override public int getCount() { if (mItems == null) { return 0; } return Math.min(MAX_ROW_DISPLAY, mItems.size()); } }
Hope this help helps you!
quangson91
source share