As I understand it _id is a required field for SQLite database tables
accessed by Android. Didn't know this also applies to string collections.
In any case, since you control the UI of your application you can also
decide to not display the _id field data. You may still need to provide the
data in the string collection though, and it probably needs to be unique
per row too (the primary key, basically)
On Monday, April 8, 2013 4:50:41 PM UTC-4, Josue C.P. wrote:
>
> Hi all!!!
>
> First of All, sorry but my english is not very well XD
>
> I'm doin my first application for Android and I have a question.
>
> My application consist in save data in a Data Base y after show them. But
> I want to Display only some columns.
> This is part of my code:
>
> * String[] campos = {"_id","marca","modelo"};*
> * Cursor c = db.query("coches", campos, null, null, null, null, null);*
>
> "_id", "marca" and "modelo" are the columns of my table. "coches" is the
> table name.
> I want display only the columns "marca" and "modelo", but if I do this...
> * *
> * String[] campos = {"marca","modelo"};*
> *
> *
> ...eclipse show me an error that says "Column '_id' does not exist". How
> can i do to show me only the columns that I want?
>
> Thanks!!!!!!!!!!
> *
> *
>
>
--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.