0

I want to pass an object from a library as a parameter to a Fragment. How can I make it parcelable to put it into a bundle? I tried creating a new class that extended the object and implemented parcelable, but it didn't work.

The library is MPAndroidChart and the object I'm trying to pass is the BarChart.

TobiasP
  • 183
  • 2
  • 12
  • 1
    If this library is open source or has publicly-visible documentation, you might want to point out the specific class, as you are more likely to get more specific help that way. – CommonsWare May 18 '17 at 23:48
  • Why can't you pass just the data? A whole bar chart shouldn't be parceled – OneCricketeer May 18 '17 at 23:56
  • @cricket_007 As long as I know, the only way to pass a parameter to a fragment is [this one](https://stackoverflow.com/questions/17436298/how-to-pass-a-variable-from-activity-to-fragment-and-pass-it-back) which requires parceling the object if it's not of a primitive type, but I may be wrong. – TobiasP May 19 '17 at 00:03
  • Please share your code. All I asked is why can't you parcel the actual data, not the entire bar chart? – OneCricketeer May 19 '17 at 08:57

0 Answers0