onRequestPermissionsResult not being called in fragment if defined in both fragment and activity

前端 未结 15 1366
余生分开走
余生分开走 2020-11-28 22:14

I have a fragment in which I have recyclerview and setting data in this recyclerview using recyclerview adapter.

Now, I am having a button in the adapter\'s list ite

15条回答
  •  忘掉有多难
    2020-11-28 22:37

    If you are working with Kotlin you should exectly specify that you are calling fragment method, not activity

     fragment.requestPermissions(permissions, PERMISSIONS_CODE);
    

    Android M Permissions: onRequestPermissionsResult() not being called

    Request runtime permissions from v4.Fragment and have callback go to Fragment?

提交回复
热议问题