I have a very simple Android activity layout like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView id="@+id/blaimg"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
Now when I do the following from onOptionsItemSelected:
ImageView imgView = (ImageView)findViewById(R.id.blaimg);
the contents of imgView is always null!
What am I doing wrong?
Thanks!
change your ImageView declaration to::