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 trial

Android Android Data Persistence CRUD Operations with SQLite Using ContentValues

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

CodeChallenge.java
ContentValues values = new ContentValues();
values.put(name ,"Rover");
values.put(type , "dog");
values.put(breed , "mixed");

Jody 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);

1 Answer

I have broken down below what the quiz is looking for.

database.insert("PETS_TABLE",null,values);

variable.insert(Table,null,value);

I still don't understand.

this is my most recent code:

ContentValues values = new ContentValues(); database.insert("breed",null,"mixed");

Okay I found it out thank you for your help