I am working with an onItemClick method on a ListActivity. I want to use putExtra to insert an array based on the position of the clicked item.
The categories array returns one null in the array. Obviously the @array/main does not work. Can anyone help? The code and XML is below.
String[] categories = getResources().getStringArray(R.array.categories);
Intent i = new Intent(parent.getContext(), CategoriesActivity.class);
i.putExtra("categories", categories[position]);
startActivity(i);
<array name="categories">
<item>@array/main</item>
</array>
<string-array name="main">
<item>News</item>
<item>Sport</item>
<item>Business</item>
<item>Comment</item>
<item>Life</item>
<item>Society</item>
<item>Culture</item>
<item>Blogs</item>
</string-array>