I´m using but i have see numbers instead of string
canvas.drawText(String.valueOf(R.string.game_lovers), 170, 150, paint);
I´m using but i have see numbers instead of string
canvas.drawText(String.valueOf(R.string.game_lovers), 170, 150, paint);
No, you can't get string from resources like that. You should do it this way:
@NonNull String getString(@NonNull Context cotext,@StringRes int stringResId) {
return cotext.getString(stringResId);
}
Where res would be you res id R.string.game_lovers
if it draws in View
class, you may try
canvas.drawText(getContext().getString(R.string.game_lovers), 170, 150, paint);