Android failed creating starting window

Source: Internet
Author: User

/***************************************************************************** * Android failed creating s tarting window * Statement: * Recently in the whole of an app in the Logcat always reported this anomaly, it does not seem to affect the operation of the program, but every time you see this anomaly is really uncomfortable, so still check the data to solve it. * 2016-5-5 Shenzhen Nanshan Ping Shan village Zengjianfeng ****************************************************** **********************/I. Reference article: Resolved _android_caused By:android.content.res.resources$notfoundexception:resource isNot a drawable (http://blog.csdn.net/tianshanaoxue/article/details/16806283Second, error:w/windowmanager (2520): Token{4116dcf8 activityrecord{410d1f00 u0 com.aplex.ethernet/. Mainactivity}} Failed creating starting window W/windowmanager (2520): android.view.InflateException:Binary XML File Line # the: Error Inflatingclass<unknown>W/windowmanager (2520): At Android.view.LayoutInflater.createView (Layoutinflater.java:613) W/windowmanager (2520): at Com.android.Internal. Policy.impl.PhoneLayoutInflater.onCreateView (Phonelayoutinflater.java: About) W/windowmanager (2520): At Android.view.LayoutInflater.onCreateView (Layoutinflater.java:660) W/windowmanager (2520): At Android.view.LayoutInflater.createViewFromTag (Layoutinflater.java:685) W/windowmanager (2520): At Android.view.LayoutInflater.rInflate (Layoutinflater.java:746) W/windowmanager (2520): At Android.view.LayoutInflater.inflate (Layoutinflater.java:489) W/windowmanager (2520): At Android.view.LayoutInflater.inflate (Layoutinflater.java:396) W/windowmanager (2520): At Android.view.LayoutInflater.inflate (Layoutinflater.java:352) W/windowmanager (2520): at Com.android.Internal. Policy.impl.PhoneWindow.generateLayout (Phonewindow.java:2812) W/windowmanager (2520): at Com.android.Internal. Policy.impl.PhoneWindow.installDecor (Phonewindow.java:2875) W/windowmanager (2520): at Com.android.Internal. Policy.impl.PhoneWindow.getDecorView (Phonewindow.java:1568) W/windowmanager (2520): at Com.android.Internal. Policy.impl.PhoneWindowManager.addStartingWindow (Phonewindowmanager.java:1591) W/windowmanager (2520): At Com.android.server.wm.windowmanagerservice$h.handlemessage (Windowmanagerservice.java:7450) W/windowmanager (2520): At Android.os.Handler.dispatchMessage (Handler.java: About) W/windowmanager (2520): At Android.os.Looper.loop (Looper.java:137) W/windowmanager (2520): At Android.os.HandlerThread.run (Handlerthread.java: -) W/windowmanager (2520): caused by:java.lang.reflect.InvocationTargetException W/windowmanager (2520): At Java.lang.reflect.Constructor.constructNative (Native Method) W/windowmanager (2520): At Java.lang.reflect.Constructor.newInstance (Constructor.java:417) W/windowmanager (2520): At Android.view.LayoutInflater.createView (Layoutinflater.java:587) W/windowmanager (2520):         ... theMore W/windowmanager (2520): Caused By:android.content.res.resources$notfoundexception:resource isNot a drawable (color or path): typedvalue{t=0x2/d=0x1010059a=-1} W/windowmanager (2520): At Android.content.res.Resources.loadDrawable (Resources.java:1927) W/windowmanager (2520): At Android.content.res.TypedArray.getDrawable (Typedarray.java:601) W/windowmanager (2520): At Android.widget.framelayout.<init> (Framelayout.java:109) W/windowmanager (2520): At Android.widget.framelayout.<init> (Framelayout.java: the) W/windowmanager (2520):         ... -More third, the solution:1. Cat Androidmanifest.xml ...<Application Android:allowbackup="true"Android:icon="@drawable/ic_launcher"Android:label="@string/app_name"Android:theme="@style/theme">        ......    2. Cat res/values/Styles.xml<resources> <!--Base application theme, dependent on API level. This theme isreplaced by Appbasetheme fromres/values-vxx/styles.xml on newer devices. -<style Name="Appbasetheme"Parent="Android:Theme.Light"> <!--Theme Customizations AvailableinchNewer API levels can goinchRes/values-vxx/styles.xml, whilecustomizations related to backward-compatibility can go here. -</style> <!--application theme. -<style Name="Apptheme"Parent="Appbasetheme"> <!--all customizations, that is specific to a particular api-level can go. -</style> <style Name="Style_quicksettings_category_text"> <item name="Android:textcolor"> @color/qs_text_title</item> <item name="android:fontfamily">sans-serif</item> </style> </resources>3. Cat res/values/Themes.xml<?xml version="1.0"encoding="Utf-8"?> <resources> <style name="Theme"> <item name="Android:windownotitle">true</item> <item name="Android:windowfullscreen">?android:windowNoTitle</item> <item name="Android:windowbackground"> @android:d rawable/screen_background_dark</item> <item name="Android:windowframe"> @null </item> <item name="Android:windowanimationstyle"> @android:style/animation.activity</item> </style> </resources>4. Modify to read as follows: Cat Res/values/Themes.xml<?xml version="1.0"encoding="Utf-8"?> <resources> <style name="Theme"Parent="Apptheme"> <item name="Android:windownotitle">true</item> <item name="Android:windowfullscreen">?android:windowNoTitle</item> <item name="Android:windowbackground"> @android:d rawable/screen_background_dark</item> <item name="Android:windowframe"> @null </item> <item name="Android:windowanimationstyle"> @android:style/animation.activity</item> </style> </resources>

Android failed creating starting window

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.