I have this array:
<string-array name="menu_array">
<item name="home" >Home</item>
<item name="new" >New</item>
<item name="history" >History</item>
<item id="categories" >Categories</item>
<item id="store" >Store</item>
<item id="configs" >Configurations</item>
And I have this:
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
mDrawerLayout.closeDrawer(mDrawerList);
Toast.makeText(SlideMenuActivity.this, "selecionado: " +
switch (position) {
case 0:
break;...
What I want: I want to be able to use the id or name of the clicked item instead of the position. But why? because everytime I change the order of the itens on the array, I also have to change the switch-case. I can't use the value of the item (Home, New,...), because it also change according to language.
<string-array name="menu_array">
<item name="home" >Home</item>
<item name="new" >Novo</item>
<item name="history" >Historico</item>
<item id="categories" >Categorias</item>
<item id="store" >Loja</item>
<item id="configs" >Configuracoes</item>
Any help?