Android 域无法使用嵌套类保存数据

Android 域无法使用嵌套类保存数据,android,database,sqlite,android-studio,realm,Android,Database,Sqlite,Android Studio,Realm,我正在为我的项目使用领域,无法保存包含嵌套类的类。我在android studio中遇到以下错误 RealmClass annotation does not support nested classes 以下是我正在做的: public class Test extends RealmObject { @SerializedName("1") @Expose private Leave leave; @SerializedName("2") @E

我正在为我的项目使用领域,无法保存包含嵌套类的类。我在android studio中遇到以下错误

RealmClass annotation does not support nested classes
以下是我正在做的:

 public class Test extends RealmObject  {

    @SerializedName("1")
    @Expose
    private Leave leave;
    @SerializedName("2")
    @Expose
    private Today today;
    @SerializedName("3")
    @Expose
    private Vehicle cab;
    @SerializedName("4")
Realm的渐变版本如下所示:

compile files('libs/realm-android-0.84.2.jar')

任何帮助都将对我非常有用。

您需要创建
realmodel的
作为独立类。尚不支持内部类。
如果您的类不能扩展
RealmObject
,则使用
@RealmClass
注释。在这种情况下,类还需要实现
realmodel
接口


阅读

中的更多内容,您需要将
realmodel的
创建为独立类。尚不支持内部类。
如果您的类不能扩展
RealmObject
,则使用
@RealmClass
注释。在这种情况下,类还需要实现
realmodel
接口


阅读0.84.2中的更多内容?为什么@EpicPandaForce刚刚使用了上述版本。如果你是MinSDK 19,那么你可以使用3.0.0,否则我建议使用1.2。0@EpicPandaForce我使用14作为MinSdk,这就是我使用1.2.0的原因。谢谢你的建议,伙计0.84.2?为什么@EpicPandaForce刚刚使用了上述版本。如果你是MinSDK 19,那么你可以使用3.0.0,否则我建议使用1.2。0@EpicPandaForce我使用14作为MinSdk,这就是我使用1.2.0的原因。谢谢你的建议,伙计。。