1
I am having a problem that when trying to make a query in the database of my application through Content Provider. When the attempt to query the database starts the application breaks.I did tests using any integer as id for the query, The application works normally searches the database and returns that it did not find the value in the database.But when I use an id the way I need it in this format:3ade68b8gc0b0b3, The application breaks.
Why do you use this format? If the ID is an integer and Contentprovider expects the URI to have an integer, you must use an integer.
– ramaral
the ID I use is a string I concateno forming the URI
– Oto Campos
I get stuck with this id format, because I’m working with an api,e this is the provided identifier, I need to use it to make comparisons and searches . Checking that the ID being consulted in the API is already in the DB of my application
– Oto Campos
If you want to access the bank for this value Content Provider must provide a method for this purpose.
– ramaral
if you do it in urimatcher?
– Oto Campos
Yeah, there’s gotta be one more
URI_MATCHER.addURI
, but instead of#
use*
. You have to change at least the methodquery
to deal with this type of URI.– ramaral
thanks friend , helped me solve. I was having a problem with Loader tb, I was forgetting to reset it.There was no renewal of the id I was looking for in DB.You can explain the difference when I use the "#" or when I use it "*".
– Oto Campos
The
#
indicates to URI_MATCHER that in this location you should find an integer, while the*
indicates a string.– ramaral