-5

Is there any way I can set toast text from .xmlfile?

for example :

 Toast.makeText(SmsManager.this,android.R.string.toast_text, Toast.LENGTH_SHORT).show();
MOHS3N
  • 229
  • 1
  • 4
  • 13
  • 1
    Create a String named as `toast_text` in `string.xml`. ANd use `Toast.makeText(SmsManager.this,R.string.toast_text, Toast.LENGTH_SHORT).show();` – ADM Aug 14 '18 at 07:24

1 Answers1

1

Of course !

If stored in the strings.xml, you can use R.string.your_text

Bruno
  • 3,872
  • 4
  • 20
  • 37