Kewin Björk Nielsen Kewin Björk Nielsen - 1 year ago 47
Android Question

how do you get strings from the xml on the toast

how do i get my strings from the xml in on my toast


<string name="Pic_taken">Billedet er nu blevet taget! </string>

in on this

Toast.makeText(getApplicationContext(), "Billedet er nu blevet taget!", Toast.LENGTH_SHORT).show();

Answer Source

Like this:

Toast.makeText(getApplicationContext(), getString(R.string.Pic_taken), Toast.LENGTH_SHORT).show();