Storing strings in android XML resource file and referencing them

tzr

New Member
I'm wondering if I should use a resource XML file for to store all the possible recipes for me rather than using an ArrayList that is hardcoded, the problem is that I don't know how to call from a resource file using the method i have...Here is a cut down version of what I want:\[code\]int recipeNumber = b.getInt("RECIPE"); //This is taken from another activity final TextView rowTextView = new TextView(this); //Create a textview rowTextView.setText(R.string.recipeNumber); //This is what i am struggling with howToLinearLayout.addView(rowTextView); //Add textview to linearlayout\[/code\]I don't know what to put in the part that references my resource file. I know I need:rowTextView.setText(R. but I'm not sure what would come after that.Im storing strings that would be for example:\[code\]<string name="1">One part Vodka, One part Coke</string><string name="2">One part Vodka, One part Lemonade</string>\[/code\]This list will be quite long so id appreciate any other suggestions on storage, bare in mind I'm pretty new to this.The recipeNumber int is what string will be called in to the textview.Thanks for any help
 
Back
Top