Skip to content

Instantly share code, notes, and snippets.

@murano500k
Created February 10, 2017 13:36
Show Gist options
  • Save murano500k/4fbbf12d21ed120319e03d29c7289862 to your computer and use it in GitHub Desktop.
Save murano500k/4fbbf12d21ed120319e03d29c7289862 to your computer and use it in GitHub Desktop.
Convert array of parcelables from intent
private PlayableItem[] toPlayableItems(Parcelable[] parcelables){
PlayableItem[] objects = new PlayableItem[parcelables.length];
System.arraycopy(parcelables, 0, objects, 0, parcelables.length);
return objects;
}
// usage
//playableItems = toPlayableItems( intent.getParcelableArrayExtra(ITEMS_LIST_EXTRA));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment