Skip to content

Instantly share code, notes, and snippets.

@xrigau
Last active October 3, 2015 00:08
Show Gist options
  • Save xrigau/2351804 to your computer and use it in GitHub Desktop.
Save xrigau/2351804 to your computer and use it in GitHub Desktop.
Parse a list of items to Json using Gson
final Type listType = new TypeToken<ArrayList<T>>() {}.getType();
String json = new Gson().toJson(list, listType);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment