We will solve this problem with a practical use of Java that you have already learned about—interfaces—along with some other tools as well, starting in the next chapter.
ArrayList
, like with Note To Self, where will it go? How would we share it between fragments (assuming both fragments need access to the same data)?There is an entirely more elegant solution that we can use to create a model layer (both the data itself and the code to maintain the data). We can use the Java singleton, and we will do so in the next chapter.
18.119.248.149