android 报错Attempt to invoke virtual method

1.报错信息如下

java.lang.RuntimeException: Unable to start activity ComponentInfo{yixing.artshow/yixing.artshow.activity.SetInputActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
                      at android.app.ActivityThread.access$800(ActivityThread.java:151)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:135)
                      at android.app.ActivityThread.main(ActivityThread.java:5254)
                      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:903)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
                   Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
                      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:715)
                      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.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)
                      at android.app.Activity.setContentView(Activity.java:2145)
                      at yixing.artshow.activity.SetInputActivity.onCreate(SetInputActivity.java:21)
                      at android.app.Activity.performCreate(Activity.java:5990)
                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 
                      at android.app.ActivityThread.access$800(ActivityThread.java:151) 
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
                      at android.os.Handler.dispatchMessage(Handler.java:102) 
                      at android.os.Looper.loop(Looper.java:135) 
                      at android.app.ActivityThread.main(ActivityThread.java:5254) 
                      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:903) 
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 
花了一个多小时找错竟然是xml中  
<view style="@style/me_line"/>
 
  
关键字view写错了,而且没有报错
应改成
iew style="@style/me_line"/>
大写 大写 大写



你可能感兴趣的:(android)