Use ContentProvider to inquire, sometimes not very spirit. Like the following code, the data exists in the database, but it can't be found. The reason may be that the field does not have a claim type:
As follows:
Private final static String sql_create_table_installed =
"CREATE TABLE if not exists" + table_installed + "("
+ "id not null,"
+ "Name text NOT NULL,"
+ "PRIMARY key (ID)"
+")";
There is no problem with this ID field. Using the following contentprovide to query will not find data ...
Contentresolver resolver = Context.getcontentresolver ();
Uri uri = Getcontenturi ();
cursor cursor = resolver.query (URI, Datacolumns.all, datacolumns.id
+ "=?", new string[] {integer.tostring (ID)},
Default_order);
Such a small problem is really no solution.
It can be found in the following ways. Directly with the parameter check.
cursor cursor = resolver.query (Getcontenturi (), Datacolumns.all,
datacolumns.id + "=" + ID, NULL, default_order);
So, write the code carefully, when creating the table, pay attention to the various field types. SQLite does not check the field type.
SQLite creates a table be sure to declare the field type (small problem with ContentProvider query)