getSupportFragmentManager().getFragments() shows a compile time error

前端 未结 3 874
小蘑菇
小蘑菇 2020-12-05 04:14

Calling getSupportFragmentManager().getFragments() shows a compile time error with the message below:

getSupportFragmentManager().getFrag

3条回答
  •  无人及你
    2020-12-05 04:36

    As noticeable in the FragmentManager documentation, getFragments() is not a public method available to apps, but an internal implementation detail of the Support Library, hence the use of the RestrictTo annotation that was added to prevent usage of private APIs.

    You'll want to change your code to not use getFragments and only use the public APIs.

提交回复
热议问题