You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when I start the app, it'll ask for permission to access files. Due to the following line in onCreate:
if (ASWP_FUPLOAD) {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 2);
}
}
This doesn't make sense unless the app's entire purpose is to upload files. Otherwise, it'll confuse the user as to why the app is asking for permission. is it possible to move this request to After the user clicks Browse in an upload form?
And here is my tiny contribution, which will help the shouldOverrideUrlLoading method work on both new as well as old SDKs
//Overriding webview URLs
@SuppressWarnings("deprecation")
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
boolean a = true;
*******
}
@TargetApi(Build.VERSION_CODES.N)
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
String url = request.getUrl().toString();
boolean a = true;
*******
}
The text was updated successfully, but these errors were encountered:
Ghazi, is there a simple fix for this? I tried copy & pasting that line of code (ActivityCompat.requestPermissions()) in various parts of the code with no luck.
Thank you for the contribution and suggesting for change in permissions Jake.
I've updated the codes and now you'll be able to handle permissions wherever you want with a new simple permission checker method introduced in the script.
Also, by default, permissions will be asked only when needed. ACCESS_FINE_LOCATION is onCreate as required, WRITE_EXTERNAL_STORAGE and CAMERA only when FileChooser method shoots.
First and foremost, thank you for your prompt reply!
I've updated the code and here is how it currently executes:
Step 1. I browse to the upload page inside the app
Step 2. Click Browse
Step 3. File Chooser pops up
Step 4. I select image
Step 5. Then it asks "app would like to access your files". (instead of at step 2)
I think this may be an issue with not the code, but the Android Emulator I'm using. I'm going to submit the app to Google Play and test on a real device. Will update you soon!
First and foremost, THANK YOU for providing this.
Currently, when I start the app, it'll ask for permission to access files. Due to the following line in onCreate:
This doesn't make sense unless the app's entire purpose is to upload files. Otherwise, it'll confuse the user as to why the app is asking for permission. is it possible to move this request to After the user clicks Browse in an upload form?
And here is my tiny contribution, which will help the shouldOverrideUrlLoading method work on both new as well as old SDKs
The text was updated successfully, but these errors were encountered: