ActivityCompat.requestPermissions does not show prompt

前端 未结 4 1645
囚心锁ツ
囚心锁ツ 2021-01-05 02:28

I\'m attempting to request ACCESS_FINE_LOCATION permissions in order to get the user\'s current location.

My logging indicates that my app does not curr

4条回答
  •  灰色年华
    2021-01-05 02:57

    After stripping out my class completely, and it still not working, I realised that this Activity is being instantiated using a TabHost.

    When I stop using the TabHost, the prompt is displayed successfully. I guess TabHosts are not supported by the new permissions prompts - is this a bug?

    Same problem as App requests aren't showing up

    I ended up creating a PermissionsRequestActivity which handles the permission request and response on behalf of my TabHost, then exits (pass the requested permission information in through the Intent extras Bundle).
    It passes back the response to the request as a Broadcast, which is picked up by my TabHost.

    Bit of a hack but works OK!

提交回复
热议问题