In android can we do some thing like R.string.navigation_item_1 = _userName.getText().toString() where _userName is a TextView and navigation_item_1 is a string name in strings.xml. If not then what is the right procedure to pass a string from MainActivity to strings.xml
2 Answers
You can not customize the resources (no matter if string, drawable or what) in android at run time. The res folder could not be modified programmatically at all. For example you could not change a drawable at run time.
More answers to a similar question here: Change value of R.string programically
If you need a string value to be saved in your app, you could use SharedPrefferences for example