Comments (3)
You should indicate the correct root directory. For example: "/".
from android-filepicker.
@dacasals as docs said you should set your root
property as the most parent - where the user can't go higher. It's boundary directory. The offset
property is the directory which you want to show to user when dialog.show()
is called. offset
must be sub-directory of root
or you will get NullPointerException
.
In my example the most parent directory is Environment.getExternalStorageDirectory()
so :
properties.root = Environment.getExternalStorageDirectory();
// in my device it's "/storage/emulated/0"
properties.offset = Environment.getExternalStorageDirectory()+ "/subfolder";
// will be "/storage/emulated/0/subfolder"
from android-filepicker.
Hi @dacasals ,
Just a few days after releasing library I received an email and an issue with a similar concern.
Here I will explain what was the issue with the library:
By default, library sets offset and root to sdcard location, You can see here.
While initializing the list, dialog checks whether an offset has been set or not. If set and location are valid, offset directory's files are shown in the dialog. This condition also adds the parent directory in the same listview. Now since you are presently in the root directory (as root and offset are same), parent directory shouldn't have been shown in the first place, next you cannot go before sdcard directory (You can't access any directory before sdcard as app don't have permission for that). Hence clicking the ... gave a NullpointerException. It was added in the root listview and wasn't supposed to be there. So in v1.0.9, I added extra checks to validate offset (That I should have added before!). You can see them here. This won't set an offset if offset equals root directory path or isn't a subdirectory of the root (Which covers the case @themysteq has mentioned). Hopefully, this was the case! If not, I would like to know what are the values you have set in root and offset properties. It is possible that os doesn't provide permission to access the directory which is the parent of offset.
P.S.: Lines tagged in links are marked with yellow color.
from android-filepicker.
Related Issues (20)
- Remove empty folders HOT 1
- Restricting files based on size
- ANR on large file selection
- Not opening dialog FilePicker automatically after user allows permission access?
- Please add support for external removable SDCard and thumbnails HOT 5
- Unable to select first file from listing HOT 1
- How apply Theme in Dilaog HOT 1
- crash when the filename is wrong decoded
- Crash when back HOT 2
- How create new folder HOT 1
- properties.offset not working in the newest version? HOT 1
- FilePickerPreference crash when trying to use .setProperties HOT 1
- Choosing directories HOT 5
- Path text gets cut off if title is more than one line
- java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.io.File.isDirectory()' on a null object reference
- Permission request even when browsing internal files
- Some problem about title HOT 1
- 不支持JPEG?
- Unable to browse external SD Card HOT 1
- Android Q unsupported
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-filepicker.