0

I am sending a broadcast with the intent containing an ArrayList of serialized objects as a intent extra.

When this arrayList contains about 500 valid objects, this is not being received by the onReceive() of the broadcast receiver. But with about 100 objects, I am able to get the ArrayList in onReceive()

Is there a known limit for the amount of data that can be received/sent using intent

arjoan
  • 1,849
  • 2
  • 20
  • 39

1 Answers1

1

This is not a good idea to pass a big amount of data through intent. The data passed through intents must be small.

I see 3 solutions:

  • Good: I suggest you to store your objects in a db and then pass the ids through your intent.
  • Medium: make a singleton (with Application class & put your list in the static instance)
  • Bad & not recommended: make your list static & pass the ids (or positions).

Hope this will help you.

AMerle
  • 4,354
  • 1
  • 28
  • 43