pilgr / Paper

Paper is a fast NoSQL-like storage for Java/Kotlin objects on Android with automatic schema migration support.
Apache License 2.0
2.35k stars 234 forks source link

saving or retrieving list is not working properly , can u show any example that covers all features #111

Closed champrocks3190 closed 6 years ago

champrocks3190 commented 6 years ago

.Object java.util.List.get(int)' on a null object reference

when reading list .Object java.util.List.get(int)' on a null object reference

   List<User> users=Paper.book().read("contacts5");
    Log.d("username",users.get(0).getUserdetails().getUsername());

even when i try to write as

List users= Paper.bookOn(Environment.getExternalStorageDirectory().getPath()).write("contacts5",user);

found io.paperdb.book required java.util.list ,, even i tried to create two uses and added them in list and added list int write parameter , but also states the same

when i used Book user=write function it works fine but not with list .

champrocks3190 commented 6 years ago

ok its fine , think we need to first initialise when writing the list ,,

but not necessary when reading ,,List users= new ArrayList<>