according to the instructions on the official website, try to save Book into Database by SugarOrm.
public class MainActivity extends AppCompatActivity {
Button btnSave;
EditText title;
EditText title2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
title = findViewById(R.id.e1);
title2 = findViewById(R.id.e2);
btnSave = findViewById(R.id.b1);
btnSave.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String temporatyTitle = title.getText().toString();
String temporaryEdition = title2.getText().toString();
Book book = new Book(temporatyTitle, temporaryEdition);
book.save();
}
});
}
}
2class
public class Book extends SugarRecord<Book> {
String title;
String edition;
public Book(){
}
public Book(String title, String edition){
this.title = title;
this.edition = edition;
}
}
I got error
no such table: BOOK
How to create this table ? I can't find this on the official website.
If you have fully setup your manifest file as recommended in the documentation. try changing your db version number to an higher value