Before use check permissions:
ContextCompat. CheckSelfPermission (activity, permission) is equal to the PackageManager. PERMISSION_GRANTED
If there is no authorization:
ActivityCompat. RequestPermissions (activity, permission, the resultcode);
Millet market when doing monkey test:
The adb shell monkey - package name p - 300 - v - throttle PCT - touch - PCT - motion 20-30 PCT - nav - PCT - majornav 15-20 PCT - appswitch 5 - PCT - anyevent 5 PCT - trackball 0 - PCT - syskeys 0 - p 1000
'% s'
Error:
Nor current process from android. Permission. READ_PHONE_STATE.
TargetSdkVersion must be greater than or equal to 26
Can you tell me how to solve?
CodePudding user response:
You see millet market notice, there will be the reminder, targetSdkVersion must be greater than or equal to 26, otherwise will not be online