You can escape the quotes with a backslash:
Toast.makeText(this, "New entry \"" +gameTitleInput+ "\" added to database!", Toast.LENGTH_LONG).show();
Вопрос
I just need to know how to surround a portion of a toast in quotes. I have done some searching on the net, but I don't see any clear instructions on how to do this. In the toast below, for example, I want to surround the variable gameTitleInput in quotes:
Toast.makeText(this, "New entry " +gameTitleInput+ " added to database!", Toast.LENGTH_LONG).show();
Any help/advice is appreciated!
Mike }
Решение
You can escape the quotes with a backslash:
Toast.makeText(this, "New entry \"" +gameTitleInput+ "\" added to database!", Toast.LENGTH_LONG).show();
Другие советы
Try with: "New entry \"" +gameTitleInput+ "\" added to database!"
Try this
Toast.makeText(this, "New entry \"" +gameTitleInput+ "\" added to database!", Toast.LENGTH_LONG).show();