Giter Club home page Giter Club logo

Comments (3)

npes87184 avatar npes87184 commented on August 28, 2024

You should indicate the correct root directory. For example: "/".

from android-filepicker.

themysteq avatar themysteq commented on August 28, 2024

@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.

singhangadin avatar singhangadin commented on August 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.