Request Permission from Application class [duplicate]
问题 This question already has an answer here : Android: ActivityCompat.requestPermissions requires activity and not context :/ (1 answer) Closed 4 years ago . As per the new Android doc, In order to collect certain data, I need to request for permission. So I am doing this : @Override public void onCreate() { super.onCreate(); ... ... if (PermissionUtility.isPermitted(applicationContext, android.Manifest.permission.READ_SMS)) { userNumber = getUserPhoneNumber(); } else { ActivityCompat