Find random string from different xml <string-array>
<p>I was trying to get a random string from the bunch of XML <code>&lt;string-array&gt;</code> resources, for which I have created a function:</p>

<pre><code>public class RandomFunction {

    String[] catagories= {"marriage","life"};

    public String getRandom(Activity activity) {
        int index = new Random().nextInt(catagories.length);
        String cat = catagories[index];


        String[] data = activity.getResources().getStringArray(R.array.**cat**);
        index = new Random().nextInt(data.length);
        cat = data[index];

        return cat;
    }  
}
</code></pre>

<p>What I am doing is taking <code>R.array.</code> and attaching the string <strong>cat</strong> afterwards but it's not working. How can I do this ?</p>