title: Android: How do I get string from resources using its name?
body: <p>I would like to have 2 languages for the UI and separate string values for them in my resource file <code>res\values\strings.xml</code>:</p>
  
  <p>
  </p>
  
  <pre><code>&lt;string name="tab_Books_en"&gt;Books&lt;/string&gt;
  &lt;string name="tab_Quotes_en"&gt;Quotes&lt;/string&gt;
  &lt;string name="tab_Questions_en"&gt;Questions&lt;/string&gt;
  &lt;string name="tab_Notes_en"&gt;Notes&lt;/string&gt;
  &lt;string name="tab_Bookmarks_en"&gt;Bookmarks&lt;/string&gt;
  
  &lt;string name="tab_Books_ru"&gt;Книги&lt;/string&gt;
  &lt;string name="tab_Quotes_ru"&gt;Цитаты&lt;/string&gt;
  &lt;string name="tab_Questions_ru"&gt;Вопросы&lt;/string&gt;
  &lt;string name="tab_Notes_ru"&gt;Заметки&lt;/string&gt;
  &lt;string name="tab_Bookmarks_ru"&gt;Закладки&lt;/string&gt;
  </code></pre>
  
  <p></p>
  
  <p>Now I need to retrieve these values dynamically in my app:</p>
  
  <pre><code>spec.setContent(R.id.tabPage1);
  String pack = getPackageName();
  String id = "tab_Books_" + Central.lang;
  int i = Central.Res.getIdentifier(id, "string", pack);
  String str = Central.Res.getString(i);
  </code></pre>
  
  <p>My problem is that <code>i = 0</code>.</p>
  
  <p>Why does not it work in my case?</p>