Question

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 }

Était-ce utile?

La solution

You can escape the quotes with a backslash:

Toast.makeText(this, "New entry \"" +gameTitleInput+ "\" added to database!", Toast.LENGTH_LONG).show();

Autres conseils

Try with: "New entry \"" +gameTitleInput+ "\" added to database!"

Try this

  Toast.makeText(this, "New entry \"" +gameTitleInput+ "\" added to database!", Toast.LENGTH_LONG).show();
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top