dougdiego / CrosswalkDemo

A simple project showing how to embed Crosswalk into an Android application.
MIT License
61 stars 33 forks source link

Android runtime permissions #8

Open razvanmitre opened 7 years ago

razvanmitre commented 7 years ago

Hello,

I am new to Android programming, and I can't figure out how to request permissions only when the user wants to upload a file. Right now I request WRITE_EXTERNAL_STORAGE permission when the app loads, but I don't think this is ok.

I have tried to override the UIClient's openFileChooser method, to request the permission there, but I found that this is called after the "choose file" popup appears, and without permission no files are shown.

Do you know of a better solution?

Thanks.