0

I am trying to send List[CustomObject] from one activity to another . The data - http://www.giantbomb.com/feeds/news/ is around 270kb . When i send only 3-4 (maybe more) elements of the custom list then second activity start without any problem . What option i have to send this data from activity to another without crash or Transaction too large exception .

randy
  • 765
  • 7
  • 24
  • You can use a database to persist data. Or structure your app in a different way - is it totally necessary to be passing the data around between activities. Using fragments means the hosting activity can provide a reference to the data to all child fragments. – Mark Jul 29 '16 at 18:19
  • Yeah its necessary to pass all data since i need all data for viewpager . Good idea about using Fragment . – randy Jul 29 '16 at 18:21
  • but seriously , is sending 270 KB of data to much to handle for intent ? – randy Jul 29 '16 at 18:22
  • can you show us logcat please – Rahul Jul 29 '16 at 18:40
  • sorry but logcat shows no single error . App is just minimized without showing ANR dialog or any message . – randy Jul 29 '16 at 18:52
  • 1
    @randy the general limit is 1mb (I believe this is shared as well) - this is nothing new, there have been numerous issues with parcelable objects hitting this limit see: http://stackoverflow.com/a/12497065/4252352 an easy way around is to save to a file, and pass a Uri/string for its retrieval, or a database, or a redesign on how the app works (as stated using fragments). It is kind of a small limit, however it does discourage using up memory to pass objects around. Personally I'd like to size the limit increased, as generally phones are a lot more powerful and have more memory nowadays. – Mark Jul 29 '16 at 21:21

0 Answers0