Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDalton Coble
6,489 PointsI have tried 3 different ways of putting the keys/values in the content value. I am just not getting it, please help.
I have tried for the past hour and a half but just don't get it.
ContentValues values = new ContentValues();
values.put(name ,"Rover");
values.put(type , "dog");
values.put(breed , "mixed");
1 Answer
Greg Schmidt
5,908 PointsI have broken down below what the quiz is looking for.
database.insert("PETS_TABLE",null,values);
variable.insert(Table,null,value);
Dalton Coble
6,489 PointsI still don't understand.
Dalton Coble
6,489 Pointsthis is my most recent code:
ContentValues values = new ContentValues(); database.insert("breed",null,"mixed");
Dalton Coble
6,489 PointsOkay I found it out thank you for your help
Greg Schmidt
5,908 PointsGreg Schmidt
5,908 PointsJody what I have provided is the answer: database.insert("PETS_TABLE",null,values);
Below is how it breaks out on the android website
insert(String table, String nullColumnHack, ContentValues values) Convenience method for inserting a row into the database.
And here is how it understand it in my beginner mind variable.insert(Table,null,value);