Skip to content
Advertisement

How to pass value from a fragment/activity to xml?

So I know data can be passed using intent between activities and fragments, but is there a way to pass the value to some XML files?

Say, I have the name and email from the login page, and I can pass it from from loginActivity to mainActivity (navigation) panel, but is there a way to pass it to strings.xml in resvalues so I can refer to it at any time?

Advertisement

Answer

You can not change /res/values in runtime because it is hardcoded.
We usually save key/value data in SharedPreferences

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement