Answer the question
In order to leave comments, you need to log in
Problem with custom permishin. How to re-request permission?
Service and client. Two applications.
<service
android:name=".NameService"
.....
android:permission="my.package.custom.PERMISSION"
android:exported="true">
.....
</service>
<uses-permission android:name=""my.package.custom.PERMISSION" />
Caused by: java.lang.SecurityException:
at android.app.ContextImpl.bindServiceCommon (ContextImpl.java:1918)
at android.app.ContextImpl.bindService (ContextImpl.java:1829)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (checkSelfPermission("my.package.custom.PERMISSION")
!= PackageManager.PERMISSION_GRANTED) {
mRequestPermission.launch("my.package.custom.PERMISSION");
return;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question