我Jetpack Navigation Component在我的项目中使用了信号活动和一些片段。
我有一个片段,其中包含从服务器端填充的列表。我在onViewCreated方法上调用getDataFromServer ,然后当用户单击项目时显示新片段。
问题是当我按下后退按钮时,onViewCreated再次在列表片段中调用。
那么如何防止重新创建我的第一个片段?我不想onViewCreated打。
android fragment android-fragments fragment-lifecycle android-architecture-navigation