How to check permission in fragment

前端 未结 9 1971
执念已碎
执念已碎 2020-12-01 03:49

I want to check a permission inside a fragment.

my code:

        // Here, thisActivity is the current activity
        if (ContextCompat.checkSelfPe         


        
9条回答
  •  没有蜡笔的小新
    2020-12-01 04:47

    onRequestPermissionsResult is invoked in the activity not the fragment. Try overriding onRequestPermissionsResult in the activity instead.

提交回复
热议问题