尝试添加Playerscore时出现领域数据库错误

时间:2019-02-25 16:07:31

标签: java android

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_save_data);
    firstname = findViewById(R.id.firstname);
    lastname = findViewById(R.id.lastname);
    submit = findViewById(R.id.submit);
    log = findViewById(R.id.log);
    playerscore = findViewById(R.id.playerscore);
    int score = getIntent().getIntExtra("SCORE", 0);
    playerscore.setText("" + score);
    realm = Realm.getDefaultInstance(); // error on this code
    submit.setOnClickListener(this);
}

在此处查看完整的代码:Score

我在上面的注释代码中一直遇到错误。错误消息是这样的:io.realm.exceptions.RealmMigrationNeededException: Migration is required due to the following errors: - Property 'User.playerscore' has been added.

0 个答案:

没有答案
相关问题