0

我遇到了一个问题,如果我在片段后台堆栈中有另一个 FriendPickerFragment,我无法在 FriendPickerFragment 中显示朋友列表。

第一个 FriendPickerFragment 加载一个朋友列表,但是当我用 FriendPickerFragment 的新实例替换它时,新的不显示任何数据。

有没有人遇到过这个并知道解决方案/解决方法?

干杯!

4

1 回答 1

0

Found the problem.

When you use the FragmentManager to add a fragment to a layout from the code the id must be unique in the whole stack of fragments.

getActivity().getSupportFragmentManager().beginTransaction()
    .add(R.id.MUST_BE_UNIQUE_IN_STACK, mPickerFragment)
    .commit();
于 2013-04-04T07:52:52.407 回答