Kewin Björk Nielsen Kewin Björk Nielsen - 4 months ago 16
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

like

<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

Like this:

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