android– 在TextView上错误膨胀xml布局ArrayIndexOutOfBoundsException

android– 在TextView上错误膨胀xml布局ArrayIndexOutOfBoundsException,第1张

概述我遇到了一个奇怪的崩溃问题.我似乎无法弄清楚问题所在.这是崩溃报告.java.lang.RuntimeException:UnabletostartactivityComponentInfo{com.bigappcompany.grocery/com.bigappcompany.grocery.activity.OrderDetailsActivity}:android.view.InflateExc

我遇到了一个奇怪的崩溃问题.我似乎无法弄清楚问题所在.

这是崩溃报告.

                  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bigappcompany.grocery/com.bigappcompany.grocery.activity.OrderDetailsActivity}: androID.vIEw.InflateException: Binary XML file line #125: Binary XML file line #125: Error inflating class <unkNown>                  at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2560)                  at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626)                  at androID.app.ActivityThread.-wrap11(ActivityThread.java)                  at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1475)                  at androID.os.Handler.dispatchMessage(Handler.java:111)                  at androID.os.Looper.loop(Looper.java:207)                  at androID.app.ActivityThread.main(ActivityThread.java:5740)                  at java.lang.reflect.Method.invoke(Native Method)                  at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)                  at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:766)               Caused by: androID.vIEw.InflateException: Binary XML file line #125: Binary XML file line #125: Error inflating class <unkNown>                  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:292)                  at androID.support.v7.app.AppCompatActivity.setContentVIEw(AppCompatActivity.java:140)                  at com.bigappcompany.grocery.activity.OrderDetailsActivity.onCreate(OrderDetailsActivity.java:11)                  at androID.app.Activity.performCreate(Activity.java:6543)                  at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)                  at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2513)                  at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626)                   at androID.app.ActivityThread.-wrap11(ActivityThread.java)                   at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1475)                   at androID.os.Handler.dispatchMessage(Handler.java:111)                   at androID.os.Looper.loop(Looper.java:207)                   at androID.app.ActivityThread.main(ActivityThread.java:5740)                   at java.lang.reflect.Method.invoke(Native Method)                   at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)                   at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:766)                Caused by: androID.vIEw.InflateException: Binary XML file line #125: Error inflating class <unkNown>                  at androID.vIEw.LayoutInflater.createVIEw(LayoutInflater.java:645)                  at com.androID.internal.policy.PhoneLayoutInflater.onCreateVIEw(PhoneLayoutInflater.java:58)                  at androID.vIEw.LayoutInflater.onCreateVIEw(LayoutInflater.java:694)                  at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:762)                  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.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:292)                   at androID.support.v7.app.AppCompatActivity.setContentVIEw(AppCompatActivity.java:140)                   at com.bigappcompany.grocery.activity.OrderDetailsActivity.onCreate(OrderDetailsActivity.java:11)                   at androID.app.Activity.performCreate(Activity.java:6543)                   at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)                   at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2513)                   at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626)                   at androID.app.ActivityThread.-wrap11(ActivityThread.java)                   at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1475)                   at androID.os.Handler.dispatchMessage(Handler.java:111)                   at androID.os.Looper.loop(Looper.java:207)                   at androID.app.ActivityThread.main(ActivityThread.java:5740)                   at java.lang.reflect.Method.invoke(Native Method)                   at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)                   at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:766)                Caused by: java.lang.reflect.InvocationTargetException                  at java.lang.reflect.Constructor.newInstance(Native Method)                  at androID.vIEw.LayoutInflater.createVIEw(LayoutInflater.java:619)                  at com.androID.internal.policy.PhoneLayoutInflater.onCreateVIEw(PhoneLayoutInflater.java:58)                   at androID.vIEw.LayoutInflater.onCreateVIEw(LayoutInflater.java:694)                   at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:762)                   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.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:292)                   at androID.support.v7.app.AppCompatActivity.setContentVIEw(AppCompatActivity.java:140)                   at com.bigappcompany.grocery.activity.OrderDetailsActivity.onCreate(OrderDetailsActivity.java:11)                   at androID.app.Activity.performCreate(Activity.java:6543)                   at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)                   at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2513)                   at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626)                   at androID.app.ActivityThread.-wrap11(ActivityThread.java)                   at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1475)                   at androID.os.Handler.dispatchMessage(Handler.java:111)                   at androID.os.Looper.loop(Looper.java:207)                   at androID.app.ActivityThread.main(ActivityThread.java:5740)                   at java.lang.reflect.Method.invoke(Native Method)                   at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)                   at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:766)                Caused by: java.lang.Arrayindexoutofboundsexception: length=38; index=384                  at androID.content.res.StringBlock.get(StringBlock.java:65)                  at androID.content.res.XmlBlock$Parser.getPooledString(XmlBlock.java:458)                  at androID.content.res.TypedArray.loadStringValueAt(TypedArray.java:1151)                  at androID.content.res.TypedArray.getString(TypedArray.java:195)                  at androID.Widget.TextVIEw.<init>(TextVIEw.java:1091)                  at androID.Widget.TextVIEw.<init>(TextVIEw.java:696)                  at androID.Widget.TextVIEw.<init>(TextVIEw.java:692)                  at java.lang.reflect.Constructor.newInstance(Native Method)                   at androID.vIEw.LayoutInflater.createVIEw(LayoutInflater.java:619)                   at com.androID.internal.policy.PhoneLayoutInflater.onCreateVIEw(PhoneLayoutInflater.java:58)                   at androID.vIEw.LayoutInflater.onCreateVIEw(LayoutInflater.java:694)                   at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:762)                   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.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:292)                   at androID.support.v7.app.AppCompatActivity.setContentVIEw(AppCompatActivity.java:140)                   at com.bigappcompany.grocery.activity.OrderDetailsActivity.onCreate(OrderDetailsActivity.java:11)                   at androID.app.Activity.performCreate(Activity.java:6543)                   at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)                   at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2513)                   at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626)                   at androID.app.ActivityThread.-wrap11(ActivityThread.java)                   at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1475)                   at androID.os.Handler.dispatchMessage(Handler.java:111)                   at androID.os.Looper.loop(Looper.java:207)                   at androID.app.ActivityThread.main(ActivityThread.java:5740)                   at java.lang.reflect.Method.invoke(Native Method)                   at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)                   at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:766) 

这是我的活动xml文件.

<androID.support.design.Widget.CoordinatorLayoutxmlns:androID="http://schemas.androID.com/apk/res/androID"xmlns:app="http://schemas.androID.com/apk/res-auto"xmlns:tools="http://schemas.androID.com/tools"androID:layout_wIDth="match_parent"androID:layout_height="match_parent"tools:context="com.bigappcompany.grocery.activity.OrderDetailsActivity"><include layout="@layout/toolbar"/><linearLayout    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    androID:orIEntation="vertical"    app:layout_behavior="@string/appbar_scrolling_vIEw_behavior">    <TextVIEw        androID:layout_wIDth="match_parent"        androID:layout_height="wrap_content"        androID:background="@color/white"        androID:paddingBottom="@dimen/narrow"        androID:paddingEnd="@dimen/medium"        androID:paddingStart="@dimen/medium"        androID:paddingtop="@dimen/narrow"        androID:text="@string/order_summary"        androID:textSize="@dimen/text_medium"/>    <linearLayout        androID:layout_wIDth="match_parent"        androID:layout_height="wrap_content"        androID:layout_margintop="@dimen/narrow"        androID:background="@color/white"        androID:paddingEnd="@dimen/medium"        androID:paddingStart="@dimen/large"        androID:paddingtop="@dimen/standard">        <TextVIEw            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:text="@string/order_number"/>        <TextVIEw            androID:layout_wIDth="0dp"            androID:layout_height="wrap_content"            androID:layout_weight="1"            androID:gravity="end"            androID:text="#123123"            androID:textcolor="@color/black"            androID:textStyle="bold"/>    </linearLayout>    <VIEw        androID:layout_wIDth="match_parent"        androID:layout_height="1dp"        androID:layout_marginEnd="@dimen/narrow"        androID:layout_marginStart="@dimen/narrow"        androID:layout_margintop="@dimen/thin"        androID:background="@color/colorBackground"/>    <androID.support.v7.Widget.RecyclerVIEw        androID:ID="@+ID/rv_order"        androID:layout_wIDth="match_parent"        androID:layout_height="0dp"        androID:layout_margintop="@dimen/thin"        androID:layout_weight="1"/>    <linearLayout        androID:layout_wIDth="match_parent"        androID:layout_height="wrap_content"        androID:layout_margintop="@dimen/narrow"        androID:background="@color/white"        androID:orIEntation="vertical"        androID:padding="@dimen/standard">        <linearLayout            androID:layout_wIDth="match_parent"            androID:layout_height="wrap_content"            androID:background="@color/white">            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="@string/cart_estimated"/>            <TextVIEw                androID:layout_wIDth="0dp"                androID:layout_height="wrap_content"                androID:layout_weight="1"                androID:gravity="end"                androID:text="95"                androID:textcolor="@color/colorPrimary"                androID:textStyle="bold"/>        </linearLayout>        <linearLayout            androID:layout_wIDth="match_parent"            androID:layout_height="wrap_content"            androID:layout_margintop="@dimen/narrow"            androID:background="@color/white">            <TextVIEw                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:text="@string/order_status"/>            <TextVIEw                androID:layout_wIDth="0dp"                androID:layout_height="wrap_content"                androID:layout_weight="1"                androID:gravity="end"                androID:text="shipped"                androID:textcolor="@color/black"                androID:textStyle="bold"/>        </linearLayout>    </linearLayout>    <linearLayout        androID:layout_wIDth="match_parent"        androID:layout_height="wrap_content"        androID:background="@color/colorPrimary"        androID:orIEntation="horizontal"        androID:padding="@dimen/standard">        <!-- line #125--> <TextVIEw             androID:layout_wIDth="0dp"            androID:layout_height="wrap_content"            androID:layout_weight="1"            androID:gravity="center"            androID:text="@string/call_us"            androID:textAllCaps="true"            androID:textcolor="@color/white"            androID:textSize="@dimen/text_big"/>        <TextVIEw            androID:layout_wIDth="0dp"            androID:layout_height="wrap_content"            androID:layout_weight="1"            androID:gravity="center"            androID:text="@string/email_us"            androID:textAllCaps="true"            androID:textcolor="@color/white"            androID:textSize="@dimen/text_big"/>        <TextVIEw            androID:layout_wIDth="0dp"            androID:layout_height="wrap_content"            androID:layout_weight="1"            androID:gravity="center"            androID:text="@string/Cancel"            androID:textAllCaps="true"            androID:textcolor="@color/transparent_White"            androID:textSize="@dimen/text_big"/>    </linearLayout></linearLayout></androID.support.design.Widget.CoordinatorLayout>

由于崩溃报告说错误似乎是在第125行,这是一个TextVIEw,如果我删除文本视图错误发生在它的兄弟TextVIEw上.

任何想法或帮助将受到高度赞赏!

UPDATE
我能够将其缩小到导致问题的一个属性,

androID:textAllCaps="true"

任何想法为什么使文本全部大写给出这个例外?

解决方法:

使用按钮或
.settransformationMethod(new AllCapstransformationMethod(getContext()))

总结

以上是内存溢出为你收集整理的android – 在TextView上错误膨胀xml布局ArrayIndexOutOfBoundsException全部内容,希望文章能够帮你解决android – 在TextView上错误膨胀xml布局ArrayIndexOutOfBoundsException所遇到的程序开发问题。

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

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

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

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

发表评论

登录后才能评论

评论列表(0条)

保存