在android中膨胀简单的xml布局时出现内存不足错误

在android中膨胀简单的xml布局时出现内存不足错误,第1张

概述我有一个用户在谷歌播放中报告的内存错误,无论我怎么努力,我似乎​​无法重现.错误显示在我的java文件的行上,我尝试设置我的文件的布局.这是logcat的完整转储:{java.lang.RuntimeException:UnabletostartactivityComponentInfo{org.djodjo.android.sport.Grassro @H_403_0@我有一个用户在谷歌播放中报告的内存错误,无论我怎么努力,我似乎​​无法重现.

@H_403_0@错误显示在我的java文件的行上,我尝试设置我的文件的布局.
这是logcat的完整转储:

@H_403_0@

      {java.lang.RuntimeException: Unable to start activity ComponentInfo{org.djodjo.androID.sport.GrassrootsDragRacing/org.djodjo.androID.sport.GrassrootsDragRacing.LogSheet}: androID.vIEw.InflateException: Binary XML file line #2: Error inflating class               at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:1970)              at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)              at androID.app.ActivityThread.access0(ActivityThread.java:128)              at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)              at androID.os.Handler.dispatchMessage(Handler.java:99)              at androID.os.Looper.loop(Looper.java:137)              at androID.app.ActivityThread.main(ActivityThread.java:4514)              at java.lang.reflect.Method.invokeNative(Native Method)              at java.lang.reflect.Method.invoke(Method.java:511)              at           com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)              at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:747)              at dalvik.system.NativeStart.main(Native Method)              Caused by: androID.vIEw.InflateException: Binary XML file line #2: Error inflating class               at androID.vIEw.LayoutInflater.createVIEw(LayoutInflater.java:606)              at com.androID.internal.policy.impl.PhoneLayoutInflater.onCreateVIEw(PhoneLayoutInflater.java:56)              at androID.vIEw.LayoutInflater.onCreateVIEw(LayoutInflater.java:653)              at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:678)              at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:466)              at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:396)              at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:352)              at com.androID.internal.policy.impl.PhoneWindow.setContentVIEw(PhoneWindow.java:274)              at androID.app.Activity.setContentVIEw(Activity.java:1835)              at org.djodjo.androID.sport.GrassrootsDragRacing.LogSheet.onCreate(LogSheet.java:20)              at androID.app.Activity.performCreate(Activity.java:4470)              at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)              at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:1934)              ... 11 more              Caused by: java.lang.reflect.InvocationTargetException              at java.lang.reflect.Constructor.constructNative(Native Method)              at java.lang.reflect.Constructor.newInstance(Constructor.java:417)              at androID.vIEw.LayoutInflater.createVIEw(LayoutInflater.java:586)              ... 23 more              Caused by: java.lang.OutOfMemoryError              at androID.graphics.Bitmap.nativeCreate(Native Method)              at androID.graphics.Bitmap.createBitmap(Bitmap.java:605)              at androID.graphics.Bitmap.createBitmap(Bitmap.java:551)              at androID.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)              at androID.graphics.BitmapFactory.finishDecode(BitmapFactory.java:618)              at androID.graphics.BitmapFactory.decodeStream(BitmapFactory.java:593)              at androID.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:445)              at androID.graphics.drawable.Drawable.createFromresourceStream(Drawable.java:775)              at androID.content.res.Resources.loadDrawable(Resources.java:1968)              at androID.content.res.TypedArray.getDrawable(TypedArray.java:601)              at androID.vIEw.VIEw.(VIEw.java:2834)              at androID.vIEw.VIEw.(VIEw.java:2771)              at androID.vIEw.VIEwGroup.(VIEwGroup.java:379)              at androID.Widget.relativeLayout.(relativeLayout.java:174)              ... 26 more
@H_403_0@任何帮助将非常感谢:)

@H_403_0@编辑

@H_403_0@

<?xml version="1.0" enCoding="utf-8"?><relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    androID:layout_wIDth="fill_parent"    androID:layout_height="fill_parent"    androID:background="@drawable/log_sheet_background_new"    androID:orIEntation="vertical" >    <relativeLayout        xmlns:androID="http://schemas.androID.com/apk/res/androID"        androID:layout_wIDth="fill_parent"        androID:layout_height="wrap_content"        androID:layout_alignParenttop="true"        androID:background="#00FFFFFF"        androID:orIEntation="horizontal" >        <!--             <ImageVIEw                  androID:ID = "@+ID/toplogo"                androID:layout_wIDth="wrap_content"                 androID:layout_height="wrap_content"                androID:background="@drawable/top_logo3"                androID:layout_alignParentleft="true"            />        -->        <ImageVIEw            androID:ID="@+ID/btnHelp"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:layout_alignParentRight="true"            androID:layout_gravity="right"            androID:layout_marginRight="3dip"            androID:layout_margintop="3dip"            androID:adjustVIEwBounds="true"            androID:scaleType="fitCenter"            androID:src="@drawable/help_up" />    </relativeLayout>    <linearLayout        androID:layout_wIDth="fill_parent"        androID:layout_height="wrap_content"        androID:layout_alignParentBottom="true"        androID:layout_marginBottom="5dip"        androID:layout_weight="1"        androID:gravity="center"        androID:orIEntation="horizontal" >        <TextVIEw            androID:ID="@+ID/btnNewLogSheet"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:layout_marginBottom="5dip"            androID:layout_marginleft="5dip"            androID:layout_marginRight="0dip"            androID:background="@drawable/info_Box_p1"            androID:clickable="true"            androID:text="Add New Log"            androID:textcolor="#FF000000"            androID:textSize="16sp"            androID:textStyle="bold" />        <TextVIEw            androID:ID="@+ID/btnDeleteall"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:layout_marginBottom="5dip"            androID:layout_marginleft="3dip"            androID:layout_marginRight="0dip"            androID:background="@drawable/info_Box_p1"            androID:clickable="true"            androID:text="Clear All"            androID:textcolor="#FF000000"            androID:textSize="16sp"            androID:textStyle="bold" />        <TextVIEw            androID:ID="@+ID/btnLogSheetPredictET"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:layout_marginBottom="5dip"            androID:layout_marginleft="3dip"            androID:layout_marginRight="0dip"            androID:background="@drawable/info_Box_p1"            androID:clickable="true"            androID:text="Predict ET"            androID:textcolor="#FF000000"            androID:textSize="16sp"            androID:textStyle="bold" />        <TextVIEw            androID:ID="@+ID/btnLogSheetListByDate"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:layout_gravity="center"            androID:layout_marginBottom="5dip"            androID:layout_marginleft="3dip"            androID:layout_marginRight="0dip"            androID:background="@drawable/info_Box_p1"            androID:clickable="true"            androID:text="Search by date"            androID:textcolor="#FF000000"            androID:textSize="16sp"            androID:textStyle="bold" />    </linearLayout></relativeLayout>

解决方法:

@H_403_0@当图像的大小大于模拟器的宽度或高度时,会出现此错误.所以检查你的图像并重新调整它们的大小.

@H_403_0@有关更多信息,请参阅此linkBinary XML file line #2: Error inflating class android.widget.LinearLayout

总结

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

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

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

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

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

发表评论

登录后才能评论

评论列表(0条)

保存