I'm just getting into android app development. I'm trying to find the value of an item in an array resource from the index, but the resource is returning an integer rather than an array. I have this piece of code:
pop1.setItems(R.array.PopupMenuListItems, new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int which ) {
Toast.makeText(getBaseContext(), "Selected " + R.array.PopupMenuListItems, Toast.LENGTH_SHORT).show();
}
});
and when the Toast message shows, it shows "Selected 2131492864", and I can't index an integer.
So, my question is how can I convert R.array.PopupMenuListItems into an array rather than an integer, so I can use R.array.PopupMenuListItems[which]?