Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的活动中有一个片段说 FRAG A,现在我在上面添加了一个片段,说 FRAG B。现在我想用 FRAG A 和 FRAG B 重新创建活动。但是这些片段应该通过配置更改手段它应该重新加载或重新创建。
只需在共享首选项中保存一个布尔值。如果 boolean 为 false,则重新加载 Frag A,如果为 true,则重新加载 Frag B。根据用户停止使用的位置,可以存储共享首选项。我假设您想在关闭然后打开的应用程序上重新创建上次看到的片段。