There is a list of lists (ArrayList>) it stores data that I have to display on the widget itself. They turn out downloading from the Internet HTML dock. and parsing it. For each widget its such a list, how do I transfer it between classes? Just as a variable? Or through the Bundle | Parcelable. In general, we need good advice.

  • Something your question caused me to think: is it not easier to load data in the second activity, usually transferring arrays is a bit problematic (or, at least, it doesn’t look good in code :)). Well, since I transmit: either in a loop through Bundle , etc., or do my own Bundle for an ArrayList . - user189127
  • @ bukashka101 As I understood, in order to pass a piece through the Bundle, you will have to write something of the type public class MyList extends ArrayList<ArrayList<String>> implements Parselable {..} I also do not really understand how to write it. Or rather, if you do your own ArrayList, you will have to write another class - public class MyInnerList extends ArrayList<String> implements Parselable {..} And what should I do as a List of MyInnerList objects? - Grigory Zaripov
  • 2
    Somehow you have painted everything too hard ... Honestly, I have never used this method, but I had the same problem, but I had a different type of data (I understood that it was better not to transmit contexts and somehow left it) , but when I asked a question here, they gave me a link on the makeover of the Bundle . On stackoverflow, your problem with ArrayList() considered specifically, here is ru.stackoverflow.com/questions/366515/arraylist-%D0%B2-bundle I think here you will answer all your questions :). - user189127

0