Open Blazeblackbird opened 7 years ago
@cfiliault I changed my int gear and int weapon to long's in my Build class. It shows no errors and the app runs, but when I click on "builds" in the nav drawer the app crashes and doesn't show any errors in the event log.
@cfiliault
After fixing about 3 Database errors I'm stuck on this one now;
android.database.sqlite.SQLiteException: table gear has no column named ARMOR (code 1): , while compiling: INSERT INTO gear(NAME, HEALTH, ARMOR, MAGICRESIST ) VALUES ('MYSTICAL MAIL', 1300, 400, 350)
@Blazeblackbird
I did a quick glance at your DatabaseHandler and saw the following:
private static final String COLUMN_ARMOR = "aromr";
and when I look at your insert query I see the following:
db.execSQL("INSERT INTO " + TABLE_GEAR + "(NAME, HEALTH, ARMOR, MAGICRESIST ) VALUES ('MYSTICAL MAIL', 1300, 400, 350)");
I think you will find you are having issues because you did not reuse your column constants and ended up with a typo.
You have the following error:
android.database.sqlite.SQLiteException: table gear has no column named ARMOR (code 1): , while compiling: INSERT INTO gear(NAME, HEALTH, ARMOR, MAGICRESIST ) VALUES ('MYSTICAL MAIL', 1300, 400, 350)
This is correct because your column is named 'aromr' not 'ARMOR'
To remedy this change
private static final String COLUMN_ARMOR = "aromr";
To:
private static final String COLUMN_ARMOR = "ARMOR";
finally you will need to uninstall and reinstall the app for the changed to take effect.
@cfiliault @RoyceNguyen Ok I got it working thus far. Now the issue I have is with our Spinners, first thing when I click on a spinner to see all the items inside it shows as a string of text like this;
Secondly, when the user hits submit and enters the build.. how do we grab the exact build for the Damage Calculator to use it?
@cfiliault Hey Cai, how do I grab my item that is selected in Spinner when user clicks submit button? I have;
DatabaseHandler db = new DatabaseHandler(getContext());
Then in submit button I have;
Errors in above line are with weapon.getSelectedItemId() and gear.getSelectedItemId()