Permission Requests causes infinite loop in OnResume

前端 未结 3 1936
春和景丽
春和景丽 2021-01-17 12:21

In API >= 23, we are required to ask users for permission at run-time. But for some reason, the permissions are causing onResume to be called infinitely. What causes this?

3条回答
  •  星月不相逢
    2021-01-17 12:54

    When you show dialog of permission question, Acitvity goes to onPause, and when dialog hides, it goes to onResume. You have to change place of asking of permission.

提交回复
热议问题