Android App with multiple views - Best Practices?

后端 未结 3 883
猫巷女王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:28

    While Intents may be a little extra work, I'd recommend using them, if you don't directly need to pass large blocks of data back and forth between the two.

    If you just need to pass information TO each of the sub-programs, then you can easily do that with putExtra(String key, Bundle values);

    By using intents, you spend a little time now in order to have a lot of flexibility later. You can start intents from different points, so you'd not need to write new code if one of your sub-applications wanted to start a different one, or you wanted a certain filetype opened with a file manager to open one of your sub-programs.

提交回复
热议问题