0
I’m trying to do a query like on sqlite.
Cursor cursor = database.rawQuery("SELECT nome FROM Armas WHERE nome LIKE ?", new String[]{name});
That String I pass like this:
data = getIntent().getStringExtra("name");
final List<String> getFinalResult = databaseAccess.pesquisaArmas("%" + data + "%");
But it’s not returning with the like, it’s returning all the records. What is the way to return only what was passed in the date variable?
Try putting simple quotes
" '%" + data + "%' "
– viana
did not work, did not return any record
– Marceloawq
But inside name has something written?! Because the logic is this same, put in quotes or simple, or put
"\"%" + data + "%\""
– viana
put a Toast and is passing yes. The variable is receiving a text.
– Marceloawq
Man, I’m almost, I say almost, sure the mistake is because of the quotation marks.
– viana
I pulled out the quotes, I gave a clean build and it worked =/
– Marceloawq
Did you take or put? Now you confused. ehueh
– viana
I took it. The way I had done was just give a clean build and it worked
– Marceloawq