P
P
poznavaka2019-07-08 22:47:04
Android
poznavaka, 2019-07-08 22:47:04

How to catch the READ_CONTACTS permission confirmation event in service?

Is it possible to somehow catch the event for the user's consent to read contacts (android.permission.READ_CONTACTS) in a class inherited from Service? I tried through the ActivityCompat.OnRequestPermissionsResultCallback interface, but it doesn't work, apparently I'm too stupid or it is registered only for an object of a class inherited from Activity. I also tried it through BroadcastReceiver, but I could not find out which ACTION needs to be registered.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2019-07-09
@poznavaka

poznavaka , the permission system is specially made so that the user can clearly understand which application the request is coming from. This requires a UI, permissions can only be requested from activities and fragments.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question