获取TextView的InflateException

时间:2016-11-12 08:52:02

标签: android textview inflate-exception

InflateException获得TextView。我不知道如何处理它,请帮助我。

这是Logcat,

Process: com.aryagami.locationservices, PID: 25870
   java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aryagami.locationservices/com.aryagami.locationservices.activities.StartScreen}: android.view.InflateException: Binary XML file line #64: Error inflating class TextView
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2308)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2368)
       at android.app.ActivityThread.access$800(ActivityThread.java:144)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1285)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:135)
       at android.app.ActivityThread.main(ActivityThread.java:5233)
       at java.lang.reflect.Method.invoke(Native Method)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
    Caused by: android.view.InflateException: Binary XML file line #64: Error inflating class TextView
       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
       at com.aryagami.util.ActionbarSetup.setupActionBar(ActionbarSetup.java:28)
       at com.aryagami.locationservices.fragments.NavigationDrawerFragment.setUp(NavigationDrawerFragment.java:519)
       at com.aryagami.locationservices.activities.StartScreen.onCreate(StartScreen.java:89)
       at android.app.Activity.performCreate(Activity.java:6001)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2261)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2368) 
       at android.app.ActivityThread.access$800(ActivityThread.java:144) 
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1285) 
       at android.os.Handler.dispatchMessage(Handler.java:102) 
       at android.os.Looper.loop(Looper.java:135) 
       at android.app.ActivityThread.main(ActivityThread.java:5233) 
       at java.lang.reflect.Method.invoke(Native Method) 
       at java.lang.reflect.Method.invoke(Method.java:372) 
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898) 
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693) 
    Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x1
       at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:572)
       at android.widget.TextView.<init>(TextView.java:1004)
       at android.widget.TextView.<init>(TextView.java:634)
       at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:59)
       at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:55)
       at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:103)
       at android.support.v7.app.AppCompatDelegateImplV9.createView(AppCompatDelegateImplV9.java:1013)
       at android.support.v7.app.AppCompatDelegateImplV9.onCreateView(AppCompatDelegateImplV9.java:1072)
       at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:44)
       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:725)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
       at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
       at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
       at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
       at com.aryagami.util.ActionbarSetup.setupActionBar(ActionbarSetup.java:28) 
       at com.aryagami.locationservices.fragments.NavigationDrawerFragment.setUp(NavigationDrawerFragment.java:519) 
       at com.aryagami.locationservices.activities.StartScreen.onCreate(StartScreen.java:89) 
       at android.app.Activity.performCreate(Activity.java:6001) 
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) 
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2261) 
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2368) 
       at android.app.ActivityThread.access$800(ActivityThread.java:144) 
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1285) 
       at android.os.Handler.dispatchMessage(Handler.java:102) 
       at android.os.Looper.loop(Looper.java:135) 
       at android.app.ActivityThread.main(ActivityThread.java:5233) 
       at java.lang.reflect.Method.invoke(Native Method) 
       at java.lang.reflect.Method.invoke(Method.java:372) 
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898) 
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693) 

0 个答案:

没有答案