To read the value of string.xml from Android

Asked 2 years ago, Updated 2 years ago, 46 views

To read the value of String.xml StringMess=R.string.message_1;I tried it like this, but the id value of the string was returned as an integer instead of a string. I'd like to read the text, what should I do?

android layout

2022-09-21 18:42

1 Answers

String mess = getResources().getString(R.string.mess_1); Do it like this


2022-09-21 18:42

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.