I wanted to put this in code snippet section but (altought it seems to work) I'm sure there are some concept error, so better some expert do some comments before.
I was trying to implement runtime permission, but I falled in a loop because permission CheckAndRequest is not a blocking code and several part of the app requires a permission.
So I have moved all my code in Main activity to a second activity MainRP. The new Main activity only ask in sequence all the permission you need. After the user has approved everything, the real activity (MainRP) is started.
A splash screen can be added to the layout of the main activity eventually.
Attached the sample project.
Any comment is appreciated.
Not sure wich problems I'll encounter for those part of code that is better to put in the starter service for example.
I was trying to implement runtime permission, but I falled in a loop because permission CheckAndRequest is not a blocking code and several part of the app requires a permission.
So I have moved all my code in Main activity to a second activity MainRP. The new Main activity only ask in sequence all the permission you need. After the user has approved everything, the real activity (MainRP) is started.
A splash screen can be added to the layout of the main activity eventually.
Attached the sample project.
Any comment is appreciated.
Not sure wich problems I'll encounter for those part of code that is better to put in the starter service for example.