Question

I was wondering how to set the second argument createChooser to be parse from strings.xml? So my app is more multilingual.

startActivity(Intent.createChooser(emailIntent, "Send mail..."));

i tried

startActivity(Intent.createChooser(emailIntent, "@string/btnsendemailtext"));

regards,

Was it helpful?

Solution

Try this.

String title = getResources().getString(R.string.btnsendemailtext);

startActivity(Intent.createChooser(emailIntent, title));

OTHER TIPS

Use:

startActivity(Intent.createChooser(emailIntent, getString(R.string.btnsendemailtext)));

Use this one:

startActivity(Intent.createChooser(emailIntent, getResources().getString(R.string.btnsendemailtext));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top