0

I have an extremely largely sized list and I want to send it through an Intent. I keep getting:

FAILED BINDER TRANSACTION !!!  (parcel size = 1959784)   

I have 5720 objects in my list, I have done some research online and it says to split the list up into smaller chunks. So, I did this: (got the same error).

intent.putExtra("cards1", list1);
intent.putExtra("cards2", list2);
intent.putExtra("cards3", list3);
intent.putExtra("cards4", list4);

You can also make your data into a singleton, but I have never dealt with singletons so I do not know the proper procedure to do this.

If anyone has insight, on how to pass extremely large data sets through an intent, please let me know!

Dave
  • 59
  • 7

1 Answers1

1

Singleton is just a class that created only once. I.e. you would have getInstance() or similar method that will create the instance only if it's null.

Then you can hold the reference to your singleton object in your app class (or create a singleton provider if you're using DI).And that's it.

You can add List<YourItems> yourList to your singleton class and do something like App.getYourSingletonInstance().saveData() in your source, and then do App.getYourSingletonInstance().getData() in your target, after which you can clean it. Happy coding.

Tejas Pandya
  • 3,987
  • 1
  • 26
  • 51
Vladimir Gladun
  • 416
  • 2
  • 16