How to centralize runtime resolution when we have several actions

Sorry for my bad english.

I have several Activityin my application, I need to centralize the resolution of the application at runtime.

Do I need to use BaseActivity?

If yes, please suggest me how to handle it in case of large quantities Activityin the application.

If not, suggest a better approach to handling it.

I want to reduce code redundancy. It is not interesting to write the same code over and over again with each Activity.

I am looking for a negative scenario where a user has refused permission, and I have to show rationality, instead of continuing to ask for permission. and based on this I have to provide a message or I need to update the interface

+4
source share
2 answers

Runtime permissions have been introduced to control hazardous resources.

Ideally, you should check the resolution every time you use the resource. This code cannot be excluded.

Then, when it comes to asking for permission, this is one line code. I do not think you have a problem with this.

. . ( ), .

, :
Location.java, , LatLon, .

, , . . , . .

.

, . Android , , , .

-2

10 , . , .

, , , , . Facebook, . , .

, . .

-2

Source: https://habr.com/ru/post/1656568/


All Articles