android - check which language text file (DE, EN) is loaded in the RAW directory
<p>I've a text file in the RAW DIrectory</p>

<p>called test.txt</p>

<p><strong>My java Code checks correctly the test.txt</strong> file with device language german. How can i check the EN-File, when the device language is english?</p>

<p>I think in line 3 of my code i have to set an if-else block to proof the raw directory?</p>

<p>THX a lot for HELP!</p>

<p><strong>My Java Code (works):</strong></p>

<hr>

<pre><code>     TextView HelpTxtMain;

     HelpTxtMain = (TextView)findViewById(R.id.TextViewMain);
     HelpTxtMain.setText(readTxtDe());


 private String readTxtDe() {

     InputStream inputStream = getResources().openRawResource(R.raw.test);

     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>
