Sharing domain objects between activities

后端 未结 1 628
别跟我提以往
别跟我提以往 2021-01-01 03:01

I have written my application logic in domain objects (to enable multiple user interfaces and porting to other platforms), and am now lookng at implementing Activities for t

相关标签:
1条回答
  • 2021-01-01 03:18

    If you're talking about Serialising object to share them between Activities you should create your own subclass of Application and store your shared state in there. A single Application object is shared by all the Activities in your app which makes it the perfect place to store non-persistent state. You can get to the Application by calling the getApplication() method on your Activity or Service.

    You'll need to specify your custom class in the <application> tag of your AndroidManifest.xml file.

    0 讨论(0)
提交回复
热议问题