layout - android.view.InflateException: Binary XML file line #8: Error inflating class android.widget.ImageView -


i'm getting below error in xml file of android project.

android.view.inflateexception: binary xml file line #8: error inflating class android.widget.imageview

i've seen this solution can't understand/ doesn't in project. there problem xml file? or need work on activity file?

i'm getting error while adding custom navigation drawer.

here error

09-14 04:23:53.841 22880-22880/? e/androidruntime: in writecrashedappname, pkgname :info.androidhive.navigationdrawer 09-14 04:23:53.851 22880-22880/? e/androidruntime: fatal exception: main process: info.androidhive.navigationdrawer, pid: 22880 java.lang.runtimeexception: unable start activity componentinfo{info.androidhive.navigationdrawer/info.androidhive.navigationdrawer.activity.splashscreen}: android.view.inflateexception: binary xml file line #8: error inflating class android.widget.imageview @ android.app.activitythread.performlaunchactivity(activitythread.java:2195) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2245) @ android.app.activitythread.access$800(activitythread.java:135) @ android.app.activitythread$h.handlemessage(activitythread.java:1196) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:136) @ android.app.activitythread.main(activitythread.java:5021) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:827) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:643) @ dalvik.system.nativestart.main(native method) caused by: android.view.inflateexception: binary xml file line #8: error inflating class android.widget.imageview @ android.view.layoutinflater.createview(layoutinflater.java:620) @ com.android.internal.policy.impl.phonelayoutinflater.oncreateview(phonelayoutinflater.java:56) @ android.view.layoutinflater.oncreateview(layoutinflater.java:669) @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:694) @ android.view.layoutinflater.rinflate(layoutinflater.java:755) @ android.view.layoutinflater.inflate(layoutinflater.java:492) @ android.view.layoutinflater.inflate(layoutinflater.java:397) @ android.view.layoutinflater.inflate(layoutinflater.java:353) @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:290) @ android.app.activity.setcontentview(activity.java:1978) @ info.androidhive.navigationdrawer.activity.splashscreen.oncreate(splashscreen.java:14) @ android.app.activity.performcreate(activity.java:5426) @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1090) @ android.app.activitythread.performlaunchactivity(activitythread.java:2159) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2245)  @ android.app.activitythread.access$800(activitythread.java:135)  @ android.app.activitythread$h.handlemessage(activitythread.java:1196)  @ android.os.handler.dispatchmessage(handler.java:102)  @ android.os.looper.loop(looper.java:136)  @ android.app.activitythread.main(activitythread.java:5021)  @ java.lang.reflect.method.invokenative(native method)  @ java.lang.reflect.method.invoke(method.java:515)  @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:827)  @ com.android.internal.os.zygoteinit.main(zygoteinit.java:643)  @ dalvik.system.nativestart.main(native method)  caused by: java.lang.reflect.invocationtargetexception @ java.lang.reflect.constructor.constructnative(native method) @ java.lang.reflect.constructor.newinstance(constructor.java:423) @ android.view.layoutinflater.createview(layoutinflater.java:594) @ com.android.internal.policy.impl.phonelayoutinflater.oncreateview(phonelayoutinflater.java:56)  @ android.view.layoutinflater.oncreateview(layoutinflater.java:669)  @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:694)  @ android.view.layoutinflater.rinflate(layoutinflater.java:755)  @ android.view.layoutinflater.inflate(layoutinflater.java:492)  @ android.view.layoutinflater.inflate(layoutinflater.java:397)  @ android.view.layoutinflater.inflate(layoutinflater.java:353)  @ com.android.internal.policy.impl.phonewindow.setcontentview(phonewindow.java:290)  @ android.app.activity.setcontentview(activity.java:1978)  @ info.androidhive.navigationdrawer.activity.splashscreen.oncreate(splashscreen.java:14)  @ android.app.activity.performcreate(activity.java:5426)  @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1090)  @ android.app.activitythread.performlaunchactivity(activitythread.java:2159)  @ android.app.activitythread.handlelaunchactivity(activitythread.java:2245)  

here activity file:

public class splashscreen extends activity {      @override     protected void oncreate(bundle savedinstancestate) {         super.oncreate(savedinstancestate);         setcontentview(r.layout.activity_splash_screen);         thread mythread = new thread(){             @override             public void run() {                 try {                     sleep(3000);                     intent intent = new intent(getapplicationcontext(),loginactivity.class);                     startactivity(intent);                     finish();                  } catch (interruptedexception e) {                     e.printstacktrace();                 }             }         };          mythread.start();     } } 

here xml file of splash screen

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     tools:context="info.androidhive.navigationdrawer.activity.splashscreen">      <imageview         android:id="@+id/pic_logo"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/ist_logo"         android:layout_margintop="50dp"         android:layout_centerhorizontal="true"/>      <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="ist library"         android:textsize="30dp"         android:layout_margintop="200dp"         android:layout_marginleft="100dp"         android:textstyle="bold"         android:textcolor="#000000"/>     <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="android application"         android:textsize="20dp"         android:textcolor="#000000"         android:layout_margintop="350dp"         android:layout_marginleft="100dp"/>     <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="of"         android:textsize="20dp"         android:textcolor="#000000"         android:layout_margintop="370dp"         android:layout_marginleft="170dp"         />     <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="library management of ist"         android:textsize="20dp"         android:textcolor="#000000"         android:layout_margintop="390dp"         android:layout_marginleft="65dp"/>  </relativelayout> 

stack trace may misleading. there might problem drawable. try different @drawable , see if works.


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -