Android App with multiple views - Best Practices?

后端 未结 3 889
猫巷女王i
猫巷女王i 2021-02-10 12:24

I am new to developing for android. I have a question regarding some best practices. My app is like a dashboard from which multiple different \"sub-activities\" can be started a

3条回答
  •  面向向阳花
    2021-02-10 13:19

    I've found in my applications that each Activity is generally responsible for a single UI view.

    So rather than loading and unloading different layouts, which can potentially get quite messy, it is better to separate each sub-activity into its own Activity class and use explicit intents (intents that name the target activity explicitly rather than relying on an intent filter) to move between them.

提交回复
热议问题