我正在研究我的一个应用程序,其中我有 9 个带有 tabhost 和 activitygroup 的选项卡
有 9 个选项卡,我的应用程序完美运行,但是当我为语言屏幕添加第 10 个选项卡时,我在下拉列表中有 7 个语言更改下拉值应用程序语言发生了变化,但之后我导航屏幕 4 到 5 次
这里发生内存不足异常 是错误异常
例外
07-04 13:41:57.941: E/AndroidRuntime(4866): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
07-04 13:41:57.941: E/AndroidRuntime(4866): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
07-04 13:41:57.941: E/AndroidRuntime(4866): at com.milagemaster.Activity_setup.onCreate(Activity_setup.java:51)
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
07-04 13:41:57.941: E/AndroidRuntime(4866): ... 31 more
07-04 13:41:57.941: E/AndroidRuntime(4866): Caused by: java.lang.reflect.InvocationTargetException
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.widget.RelativeLayout.<init>(RelativeLayout.java:171)
07-04 13:41:57.941: E/AndroidRuntime(4866): at java.lang.reflect.Constructor.constructNative(Native Method)
07-04 13:41:57.941: E/AndroidRuntime(4866): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
07-04 13:41:57.941: E/AndroidRuntime(4866): ... 39 more
07-04 13:41:57.941: E/AndroidRuntime(4866): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:447)
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.content.res.Resources.loadDrawable(Resources.java:1705)
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.content.res.TypedArray.getDrawable(TypedArray.java:548)
07-04 13:41:57.941: E/AndroidRuntime(4866): at android.view.View.<init>(View.java:1850)
07-04 13:41:57.941: E/AndroidRuntime(4866): at
布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relroot"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg"
android:gravity="top" >
<LinearLayout
android:id="@+id/lnrTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical" >
<com.milagemaster.utility.Header
android:id="@+id/header"
android:layout_width="fill_parent"
android:layout_height="50dp" />
<RelativeLayout
android:id="@+id/relativeHome"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/title" >
<TextView
android:id="@+id/txtAddData"
style="@style/TitleTextAppearance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/results"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/black" />
<Button
android:id="@+id/btnEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="Send Mail"
android:visibility="visible" />
</RelativeLayout>
</LinearLayout>
<FrameLayout
android:id="@+id/lnrscroll_barsMain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/lnrTitle"
android:layout_centerHorizontal="true" >
<ImageView
android:id="@+id/imgShadow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shadow_title" />
</FrameLayout>
<ScrollView
android:id="@+id/scroll_barsMain"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/lnrTitle"
android:layout_marginBottom="10dp"
android:fadingEdge="none"
android:scrollbars="vertical" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="@+id/relativeResult"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="top" >
<LinearLayout
android:id="@+id/relativetitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:background="@drawable/top_blue" >
<TextView
android:id="@+id/txtResultTitle"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:gravity="center_horizontal"
android:text="@string/vehcile"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/black"
android:textSize="16dp" />
<Spinner
android:id="@+id/spnSelectVehicle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dp"
android:background="@drawable/dropdown"
android:paddingLeft="10dp" />
</LinearLayout>
<!--
<TextView
android:id="@+id/txtResultTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:background="@drawable/top_blue"
android:gravity="center_vertical|center_horizontal"
android:text="your vehicle"
android:textColor="@color/black"
android:textSize="18dp" />
-->
<LinearLayout
android:id="@+id/frameresult"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/relativetitle"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="@drawable/bg_box"
android:orientation="vertical" >
<TextView
android:id="@+id/txtResult"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:text=""
android:textColor="@color/black"
android:textSize="14dp" />
<TextView
android:id="@+id/txtDate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:gravity="center_vertical|center_horizontal"
android:text="(mpg/kpl)"
android:textColor="@color/mileage1"
android:textSize="14dp"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="vertical" >
<TextView
android:id="@+id/txtAvg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal"
android:text=""
android:textColor="@color/mileage1"
android:textSize="22sp"
android:textStyle="bold"
android:visibility="gone" />
<TextView
android:id="@+id/txtAddFirstTime"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal"
android:text=""
android:textColor="@color/gray_text"
android:textSize="12dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/lnrLifeTime"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="vertical" >
<TextView
android:id="@+id/txtResultLifeTime"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:gravity="center"
android:text=""
android:textColor="@color/black"
android:textSize="14dp"
android:visibility="gone" />
<TextView
android:id="@+id/txtLifeMileage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:gravity="center_vertical|center_horizontal"
android:text="(mpg/kpl)"
android:textColor="@color/mileage1"
android:textSize="14dp"
android:textStyle="bold"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
<Button
android:id="@+id/btnSave"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/frameresult"
android:layout_centerHorizontal="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="15dp"
android:background="@drawable/themed_btnlarge"
android:text="@string/savelocationasfavorite"
android:textSize="16sp" />
<LinearLayout
android:id="@+id/frameButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/btnSave"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="15dp" android:gravity="center_vertical">
<Button
android:id="@+id/btnChartMilage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/themed_mileagechart"
android:text="@string/mileagechart"
android:textSize="14dp" />
<Button
android:id="@+id/btnCostGallons"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/themed_fuelcost"
android:text="Cost/unit Chart"
android:textSize="14dp" />
<Button
android:id="@+id/btnChartFuel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/themed_fualpricechart"
android:text="@string/fuelchart"
android:textSize="14dp" />
</LinearLayout>
<Button
android:id="@+id/btnShare"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/frameButton"
android:layout_centerHorizontal="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="15dp"
android:background="@drawable/themed_btnlarge"
android:text="@string/share"
android:textSize="16sp" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
请给我一些建议