android– 获取二进制XML文件行#141:尝试在空对象引用上调用虚方法’boolean java.lang.String.equals(java.lang.Object)’

android– 获取二进制XML文件行#141:尝试在空对象引用上调用虚方法’boolean java.lang.String.equals(java.lang.Object)’,第1张

概述logcat的05-1119:14:52.5674489-4489/?E/AndroidRuntime:FATALEXCEPTION:mainProcess:com.grab.deals.dealcart,PID:4489java.lang.RuntimeException:UnabletostartactivityComponentInfo

logcat的

05-11 19:14:52.567 4489-4489/? E/AndroIDRuntime: FATAL EXCEPTION: main                                                         Process: com.grab.deals.dealcart, PID: 4489       java.lang.RuntimeException: Unable to start activity ComponentInfo{com.grab.deals.dealcart/com.grab.deals.dealcart.Full_vIEw.Full_vIEw}: androID.vIEw.InflateException: Binary XML file line #141: 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:2416)       at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)       at androID.app.ActivityThread.-wrap11(ActivityThread.java)       at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)       at androID.os.Handler.dispatchMessage(Handler.java:102)       at androID.os.Looper.loop(Looper.java:148)       at androID.app.ActivityThread.main(ActivityThread.java:5417)       at java.lang.reflect.Method.invoke(Native Method)       at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)       at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:616)       Caused by: androID.vIEw.InflateException: Binary XML file line #141: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference       at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:539)       at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:423)       at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:374)       at androID.support.v7.app.AppCompatDelegateImplV9.setContentVIEw(AppCompatDelegateImplV9.java:284)       at androID.support.v7.app.AppCompatActivity.setContentVIEw(AppCompatActivity.java:143)       at com.grab.deals.dealcart.Full_vIEw.Full_vIEw.onCreate(Full_vIEw.java:13)       at androID.app.Activity.performCreate(Activity.java:6237)       at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)       at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2369)       at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)        at androID.app.ActivityThread.-wrap11(ActivityThread.java)        at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)        at androID.os.Handler.dispatchMessage(Handler.java:102)        at androID.os.Looper.loop(Looper.java:148)        at androID.app.ActivityThread.main(ActivityThread.java:5417)        at java.lang.reflect.Method.invoke(Native Method)        at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)        at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:616)        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:738)       at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:704)       at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:835)       at androID.vIEw.LayoutInflater.rInflateChildren(LayoutInflater.java:798)       at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:838)       at androID.vIEw.LayoutInflater.rInflateChildren(LayoutInflater.java:798)       at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:838)       at androID.vIEw.LayoutInflater.rInflateChildren(LayoutInflater.java:798)       at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:838)       at androID.vIEw.LayoutInflater.rInflateChildren(LayoutInflater.java:798)       at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:838)       at androID.vIEw.LayoutInflater.rInflateChildren(LayoutInflater.java:798)       at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:515)       at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:423)        at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:374)        at androID.support.v7.app.AppCompatDelegateImplV9.setContentVIEw(AppCompatDelegateImplV9.java:284)        at androID.support.v7.app.AppCompatActivity.setContentVIEw(AppCompatActivity.java:143)        at com.grab.deals.dealcart.Full_vIEw.Full_vIEw.onCreate(Full_vIEw.java:13)        at androID.app.Activity.performCreate(Activity.java:6237)        at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)        at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2369)        at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)        at androID.app.ActivityThread.-wrap11(ActivityThread.java)        at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)        at androID.os.Handler.dispatchMessage(Handler.java:102)        at androID.os.Looper.loop(Looper.java:148)        at androID.app.ActivityThread.main(ActivityThread.java:5417)        at java.lang.reflect.Method.invoke(Native Method)        at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)        at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

ExtendVIEw.xml

    <relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    xmlns:tools="http://schemas.androID.com/tools"    xmlns:app="http://schemas.androID.com/apk/res-auto"    androID:ID="@+ID/activity_full_vIEw"    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent">    <ScrollVIEw        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent">        <linearLayout            androID:layout_wIDth="match_parent"            androID:layout_height="match_parent"            androID:orIEntation="vertical">    <androID.support.v7.Widget.CardVIEw        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent"        androID:layout_margin="5dp">        <linearLayout            androID:layout_wIDth="match_parent"            androID:layout_height="match_parent"            androID:orIEntation="vertical">        <ImageVIEw            androID:layout_wIDth="match_parent"            androID:layout_height="300dp"            androID:ID="@+ID/img"/>        <VIEw            androID:layout_wIDth="match_parent"            androID:layout_height="1dp"/>            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="Designer shirt"                androID:textSize="15dp"                androID:layout_marginleft="10dp"                androID:textcolor="#000"/>            <linearLayout                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:orIEntation="horizontal">                <TextVIEw                    androID:layout_wIDth="wrap_content"                    androID:layout_height="wrap_content"                    androID:textSize="12dp"                    androID:text="Speatial Price"                    androID:layout_marginleft="10dp"                    androID:textcolor="#34a853"/>                <TextVIEw                    androID:layout_wIDth="wrap_content"                    androID:layout_marginleft="5dp"                    androID:layout_height="wrap_content"                    androID:textcolor="#000"                    androID:text="Ends in few hours"                   />            </linearLayout>            <linearLayout                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:orIEntation="horizontal">            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:textSize="20dp"                androID:text="25,000"                androID:layout_marginleft="10dp"                androID:textcolor="#000"/>                <TextVIEw                    androID:layout_wIDth="wrap_content"                    androID:layout_marginleft="10dp"                    androID:layout_height="wrap_content"                    androID:textcolor="@color/colorPrimary"                    androID:text="70%off"                    androID:textSize="15dp"/>            </linearLayout>        <linearLayout            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:orIEntation="horizontal">            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_marginleft="10dp"                androID:layout_height="wrap_content"                androID:textcolor="#34a853"                androID:text="4.1"/>            <ImageVIEw                androID:layout_wIDth="15dp"                androID:layout_height="15dp"                app:srcCompat="@drawable/ic_star_border_black_24dp"/>            </linearLayout>            <VIEw                androID:layout_wIDth="match_parent"                androID:layout_height="1dp"/><linearLayout    androID:layout_wIDth="match_parent"    androID:layout_height="wrap_content"    androID:orIEntation="horizontal"    androID:gravity="center"    androID:layout_gravity="center"    androID:layout_marginBottom="5dp"> <ImageVIEw     androID:layout_wIDth="30dp"     androID:layout_height="30dp"     app:srcCompat="@drawable/copy"/>    <TextVIEw        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:textcolor="#000"        androID:layout_marginleft="10dp"        androID:text="copy Coupon"        androID:textSize="20sp"        /></linearLayout>        </linearLayout>    </androID.support.v7.Widget.CardVIEw>        <androID.support.v7.Widget.CardVIEw            androID:layout_wIDth="match_parent"            androID:layout_height="wrap_content"            androID:layout_margin="5dp"            >            <linearLayout                androID:layout_wIDth="match_parent"                androID:layout_height="wrap_content"                androID:orIEntation="vertical"><TextVIEw    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    androID:text="Details"    androID:layout_margin="20dp"    androID:textSize="20sp"    androID:textcolor="#000"/>                <vIEw                    androID:layout_wIDth="match_parent"                    androID:layout_height="1dp"/>                <TextVIEw                    androID:layout_wIDth="wrap_content"                    androID:layout_height="wrap_content"                    androID:textSize="17sp"                    androID:textcolor="#000"                    androID:layout_margin="20dp"                    androID:text="Heighlets \n*shgdfshdflshflsjh\n*a;sjkdfJshgf"/>            </linearLayout>        </androID.support.v7.Widget.CardVIEw>            <androID.support.v7.Widget.CardVIEw                androID:layout_wIDth="match_parent"                androID:layout_height="wrap_content"                androID:layout_margin="5dp"                >                <linearLayout                    androID:layout_wIDth="match_parent"                    androID:layout_height="wrap_content"                    androID:orIEntation="vertical">                    <TextVIEw                        androID:layout_wIDth="match_parent"                        androID:layout_height="match_parent"                        androID:text="Terms and Conditions"                        androID:layout_margin="20dp"                        androID:textSize="20sp"                        androID:textcolor="#000"/>                    <vIEw                        androID:layout_wIDth="match_parent"                        androID:layout_height="1dp"/>                    <TextVIEw                        androID:layout_wIDth="wrap_content"                        androID:layout_height="wrap_content"                        androID:textSize="17sp"                        androID:textcolor="#000"                        androID:layout_margin="20dp"                        androID:text="Heighlets \n*shgdfshdflshflsjh\n*a;sjkdfJshgf"/>                </linearLayout>            </androID.support.v7.Widget.CardVIEw>            <androID.support.v7.Widget.CardVIEw                androID:layout_wIDth="match_parent"                androID:layout_height="wrap_content"                androID:layout_margin="5dp"                >                <linearLayout                    androID:layout_wIDth="match_parent"                    androID:layout_height="wrap_content"                    androID:orIEntation="vertical">                    <TextVIEw                        androID:layout_wIDth="match_parent"                        androID:layout_height="match_parent"                        androID:text="ratings &amp; RevIEws"                        androID:layout_margin="20dp"                        androID:textSize="20sp"                        androID:textcolor="#000"/>                    <vIEw                        androID:layout_wIDth="match_parent"                        androID:layout_height="1dp"/>                    <linearLayout                        androID:layout_wIDth="wrap_content"                        androID:layout_height="wrap_content"                        androID:layout_gravity="center"                        androID:layout_margin="20dp"                        androID:orIEntation="vertical">                    <linearLayout                        androID:layout_wIDth="wrap_content"                        androID:layout_height="wrap_content"                        androID:layout_gravity="center"                        androID:orIEntation="horizontal">                        <TextVIEw                            androID:layout_wIDth="wrap_content"                            androID:layout_height="wrap_content"                            androID:text="4.1"                            androID:layout_marginRight="10dp"                            androID:textSize="40sp"/>                        <ImageVIEw                            androID:layout_wIDth="50dp"                            androID:layout_height="50dp"                            app:srcCompat="@drawable/ic_star_border_black_24dp"/>                    </linearLayout>                        <TextVIEw                            androID:layout_wIDth="wrap_content"                            androID:layout_height="wrap_content"                            androID:text="1,500 RevIEws"                            />                    </linearLayout>                           </linearLayout>            </androID.support.v7.Widget.CardVIEw>    </linearLayout>        </ScrollVIEw><linearLayout    androID:layout_wIDth="match_parent"    androID:layout_height="wrap_content"    androID:orIEntation="horizontal"    androID:background="#fff"    androID:layout_alignParentBottom="true"    androID:gravity="center">    <button        androID:layout_wIDth="180dp"        androID:layout_height="50dp"        androID:text="Share"        />    <button        androID:layout_wIDth="180dp"        androID:layout_height="50dp"        androID:text="Visit"        androID:textcolor="#fff"                androID:background="@color/colorPrimary"/></linearLayout></relativeLayout>

Full_VIEw.java

public class Full_VIEw extends Fragment {    @Nullable    @OverrIDe    public VIEw onCreateVIEw(LayoutInflater inflater, @Nullable VIEwGroup container, @Nullable Bundle savedInstanceState) {        VIEw rootvIEw = inflater.inflate(R.layout.activity_full_vIEw,container,false);        return rootvIEw;    }}

解决方法:

 <vIEw                androID:layout_wIDth="match_parent"                androID:layout_height="1dp"/>

将视图更改为VIEw
 (小写v到大写V)

总结

以上是内存溢出为你收集整理的android – 获取二进制XML文件行#141:尝试在空对象引用上调用虚方法’boolean java.lang.String.equals(java.lang.Object)’全部内容,希望文章能够帮你解决android – 获取二进制XML文件行#141:尝试在空对象引用上调用虚方法’boolean java.lang.String.equals(java.lang.Object)’所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1098266.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存