Assigned
Status Update
Comments
yb...@google.com <yb...@google.com> #2
After looking more into this issue, ViewModels are persisted using retained fragments. After adding retained fragments to the sample app, we can observe that retained fragments are not able to survive landscape lock and unlock scenario either.
yb...@google.com <yb...@google.com> #3
Hey, currently I can't reproduce your issue.
Link you provided doesn't work, in my simple test project I don't observe described issue.
Could you please say reupload your project somewhere else?
Could you please say what kind of lockscreen, do you use? (it may effect issue)
Could you reproduce this behavior on other devices?
Link you provided doesn't work, in my simple test project I don't observe described issue.
Could you please say reupload your project somewhere else?
Could you please say what kind of lockscreen, do you use? (it may effect issue)
Could you reproduce this behavior on other devices?
Description
Version used: 1.0.0-alpha3
Devices/Android versions reproduced on: n/a
If I have a class like this:
@TypeConverters({TypeTransmogrifier.class})
class Plan {
@PrimaryKey
public final String id;
@TypeConverters({Priority.class})
public final Priority priority;
public final Date startTime;
public final Date creationTime;
public final Date updateTime;
// other good stuff here
}
and a subclass like this:
@Entity(tableName = "trips")
class Trip extends Plan {
// other good stuff here
}
then the Room annotation processor fails with:
Plan.java:34: error: Cannot figure out how to save this field into database. You can consider adding a type converter for it.
public final Date startTime;
^
Plan.java:35: error: Cannot figure out how to save this field into database. You can consider adding a type converter for it.
public final Date creationTime;
^
Plan.java:36: error: Cannot figure out how to save this field into database. You can consider adding a type converter for it.
public final Date updateTime;
^
If I move @TypeConverters({TypeTransmogrifier.class}) to Trip, then everything is fine. However, the field-level @TypeConverters annotation for the Priority field is inherited just fine. It feels like either both should work via inheritance or neither should.
If this is intended (or is due to some overall limitation that you can't work around), it's probably worth a note in the @TypeConverters JavaDocs.
Thanks!