java - Image Crashes the Application -


i'm using navigation fragment template in android sutdio. have added imageview in fragment_main.xml follows

<imageview         android:layout_width="match_parent"         android:layout_height="match_parent"         android:id="@+id/imageview"         android:src="@drawable/at"         android:layout_below="@+id/section_label"         android:layout_alignparentleft="true"         android:layout_alignparentstart="true"         android:layout_margintop="80dp" /> 

and java code follows in oncreate method.

img = (imageview)findviewbyid(r.id.imageview); 

in section attached method.

img.setimageresource(r.drawable.at); 

everytime run code crashes. if image source set in xml works awesomely well, when use java file change imagesource. crashes saying unfortunately application has stopped. image details if necessary image size:32.3 kb dimensions: 450*432 pixels

see android console log,if can find source of error there

is crash reports coming version of android, , have resources in qualified folders, i.e. "drawable-mdpi" instead of "drawable"? read http://developer.android.com/guide/topics/resources/providing-resources.html

if using eclipse, have tried cleaning , rebuilding project? fixed similar problem having.


Comments