I'm trying to check permission in activity as below,
int permission = ContextCompat.checkSelfPermission(this, Manifest.permission.GET_ACCOUNT);
But I'm getting error at GET_ACCOUNT
as Cannot resolve symbol 'GET_ACCOUNT'
.
Kindly help what code should I add to fix this?
Thanks in advance.
The following code worked for me,
Declare below code as:
Call following code in your onCreate method:
in method onRequestPermissionsResult method,
First GET_ACCOUNT is not defined in android.Manifest.permission, it is GET_ACCOUNTS
Second, change your Manifest file to use GET_ACCOUNTS
then in your code file i.e. java file write like this.
Check documentation GET_ACCOUTNS.
It should be
instead of
Try like this
Don't forget to add permission on your Manifest
Import this library in your class