@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.