acess file in raw folder in android by calling them from their names
<p>My code is below:
I am not able to use a string in the file name. Any suggestions? 
If i use R.raw.anyString , it shows error</p>

<pre><code>tv3.setText(readTxt());
}

private String readTxt(){
    InputStream inputStream = getResources().openRawResource(R.raw.filname);
    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();

    int i;
    try {
        i = inputStream.read();
        while (i != -1)
        {
            byteArrayOutputStream.write(i);
            i = inputStream.read();
        }
        inputStream.close();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    return byteArrayOutputStream.toString();
}   
</code></pre>
