How to prevent calling onCreateView when back button pressed in fragment in android

后端 未结 3 2037
执念已碎
执念已碎 2021-02-12 13:21

In my application, I have tabbar functionality. In one tab i am displaying server data in lisview, and on clicking on that detail page for that list item will be open in new fra

3条回答
  •  感情败类
    2021-02-12 13:55

    You should cache your data objects apart from view variables as their references needs to be updated if you are fetching any data from server and don't want to make a call again then use branching to branch out that code.

    Create an init() method where you do all initialization and server calls and logically branch out call to init() method whenever you don't want to call init().

提交回复
热议问题