Answer the question
In order to leave comments, you need to log in
Is it possible to use strings from values/strings.xml (Android) in code?
For example, is it possible here:
Toast.makeText(getApplicationContext(), "TEXT-TEXT-TEXT", Toast.LENGTH_LONG).show();
Answer the question
In order to leave comments, you need to log in
Something like that:
Or call getString() right away, but it depends on where to call the method:
Toast.makeText(getApplicationContext(), getString(R.string.your_text), Toast.LENGTH_LONG).show();
Toast has an overload of the makeText() method that immediately takes the id of a string resource as input
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question