Skip to content

Realm will crash when device orientation changes #9

@markzyu

Description

@markzyu

This bug can be reproduced (but not related to changes brought) in commit 114a172, by changing the device orientation while browsing MainActivity.

Caused by: java.lang.IllegalStateException: This Realm instance has already been closed, making it unusable.
   at io.realm.BaseRealm.checkIfValid(BaseRealm.java:344)
   at io.realm.Realm.where(Realm.java:880)
   at com.takefive.ledger.MainActivity.onCreate(MainActivity.java:110)
   at android.app.Activity.performCreate(Activity.java:5990)
   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2311)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2420) 
   at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3980) 
   at android.app.ActivityThread.access$1000(ActivityThread.java:154) 
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1327) 
   at android.os.Handler.dispatchMessage(Handler.java:102) 
   at android.os.Looper.loop(Looper.java:135) 
   at android.app.ActivityThread.main(ActivityThread.java:5294) 
   at java.lang.reflect.Method.invoke(Native Method) 
   at java.lang.reflect.Method.invoke(Method.java:372) 
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:910) 
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:705) 
   at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:114)
``` 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions