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

I am getting a black screen #118

Closed andrisole92 closed 6 years ago

andrisole92 commented 6 years ago

The screen is getting black on Android when I calling:

I am instantiating it like that: `public class App extends Application {

@Override
public void onCreate() {
    super.onCreate();
    Paper.init(getApplicationContext());
}

}`

And the calling Paper.book().write(Constants.ROSTER, roster);

I am using Android Emulator with permissions:

`

`

Does anyone know why?

Thanks

pilgr commented 6 years ago

Please provide sufficient info. The issue will remain closed until info is received.

andrisole92 commented 6 years ago

What info do you need? I have just updated it.

andrisole92 commented 6 years ago

It is also complaining about this, when I am calling Paper.book().write(): 02-20 15:47:01.474 1500-1513/? E/memtrack: Couldn't load memtrack module 02-20 15:47:01.474 1500-1513/? W/android.os.Debug: failed to get memory consumption info: -1

pilgr commented 6 years ago

I suppose you are doing writing in UI thread and so your UI thread being locked by the writing process. All long running operations should be called in background thread. Also I'd suggest to check out the code on real devices (in case if something wrong with emulator)

andrisole92 commented 6 years ago

Thanks @pilgr, I got to run it in the new Thread.

andrisole92 commented 6 years ago

However my app is crashing now.