I'm just starting with android and I am trying to set an ImageView resource to be an id (passed from another activity) from an array.
This is the relevant part of the activity code:
Bundle extras = getIntent().getExtras();
int bNumber = extras.getInt("number");
Resources res = getResources();
int[] bLogos = res.getIntArray(R.array.bLogos);
int cImage = bLogos[bNumber];
ImageView imageLayout = (ImageView)findViewById(R.id.image);
imageLayout.setImageResource(cImage);
This is the relevant activity layout:
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="0dp"
android:paddingTop="0dp" />
And this is the array:
<array name="bLogos">
<item>@drawable/logo1</item>
<item>@drawable/logo2</item>
<item>@drawable/logo3</item>
</array>
The problem is that my setImageResource isn't working on emulation, the drawable isn't loading. And Eclipse doesn't tell me of any errors in the code.
Any help would be appreciated.