Get permisssions in java

So I was making a wallpaper picker extension, and I need to get a permission from the user. The permission is:


How do I do this? Just saying, I was following this post:

Programmatically set android phone’s background

@UsesPermissions(permissionNames = "android.permission.SET_WALLPAPER") add this line into your code.


Thanks for the quick answer! Stay safe!

1 Like

are there any imports?

It says cannot find symbol error...

You have to import UsesPermissions from the annotations package. The annotation must be put on the class.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.