Skip to content

Instantly share code, notes, and snippets.

@bradley-curran
Created March 22, 2014 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradley-curran/9703871 to your computer and use it in GitHub Desktop.
Save bradley-curran/9703871 to your computer and use it in GitHub Desktop.
How to ram the contents of an adapter into a linear layout
// Needless to say, don't use this with an adapter with a lot of items.
// Use a list view instead
public static void ram(ViewGroup parent, BaseAdapter adapter) {
for (int i = 0; i < adapter.getCount(); i++) {
View view = adapter.getView(i, null, parent);
parent.addView(view);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment