InflatExceptionが発生するインテントに問題があります。これは、メニューであるメインアクティビティのボタンのいずれかをクリックすると発生します。ログCatによると、問題はメインアクティビティのxmlにあるはずです。
メインのアクティビティの画像をさらに圧縮しようとしましたが、何も圧縮しなかったので、finish()を使用することを考えました。インテントを呼び出した後、この問題を解決するのに役立つメモリが解放されますが、何もありません。アイデアは大歓迎です。
更新:メモリエラーは、このレイアウトを膨らませたときではなく、インテントの後に表示されます。起動しようとしているアクティビティは現在空です。同じ背景しかありません。まだプログラムしていません。まれなエラーです
update2:セレクターのすべてのxmlファイル
メインアクティビティのXMLファイル:
<?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/basegenerica"
android:orientation="vertical" >
<Button
android:id="@+id/twtbtm"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:layout_toLeftOf="@+id/facebtm"
android:adjustViewBounds="true"
android:background="@drawable/tww"
android:clickable="true"
android:scaleType="fitStart" />
<Button
android:id="@+id/facebtm"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:adjustViewBounds="true"
android:background="@drawable/face"
android:clickable="true"
android:scaleType="fitStart" />
<Button
android:layout_width="fill_parent"
android:layout_height="110dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_below="@+id/facebtm"
android:id="@+id/logobancovw"
android:background="@drawable/logobanco" />
<Button
android:id="@+id/beneficiosbtm"
android:layout_width="fill_parent"
android:layout_height="37dp"
android:layout_below="@+id/logobancovw"
android:layout_marginBottom="6dp"
android:layout_marginLeft="35dp"
android:layout_marginRight="35dp"
android:adjustViewBounds="true"
android:background="@layout/btnbeneficios"
android:clickable="true"
android:scaleType="fitEnd" />
<Button
android:id="@+id/consultabtm"
android:layout_below="@+id/beneficiosbtm"
android:layout_width="fill_parent"
android:layout_height="37dp"
android:layout_marginBottom="6dp"
android:layout_marginLeft="35dp"
android:layout_marginRight="35dp"
android:adjustViewBounds="true"
android:background="@layout/btnconsulta"
android:clickable="true"
android:scaleType="fitEnd" />
<Button
android:id="@+id/cajerobtm"
android:layout_below="@+id/consultabtm"
android:layout_width="fill_parent"
android:layout_height="37dp"
android:layout_marginBottom="6dp"
android:layout_marginLeft="35dp"
android:layout_marginRight="35dp"
android:adjustViewBounds="true"
android:background="@layout/btncajeros"
android:clickable="true"
android:scaleType="fitEnd" />
<Button
android:id="@+id/promobtm"
android:layout_below="@+id/cajerobtm"
android:layout_width="fill_parent"
android:layout_height="37dp"
android:layout_marginBottom="6dp"
android:layout_marginLeft="35dp"
android:layout_marginRight="35dp"
android:adjustViewBounds="true"
android:background="@layout/btnpromo"
android:clickable="true"
android:scaleType="fitStart" />
<Button
android:id="@+id/indicadoresbtm"
android:layout_below="@+id/promobtm"
android:layout_width="fill_parent"
android:layout_height="37dp"
android:layout_marginBottom="6dp"
android:layout_marginLeft="35dp"
android:layout_marginRight="35dp"
android:adjustViewBounds="true"
android:background="@layout/btnindicadores"
android:clickable="true"
android:scaleType="fitEnd" />
<Button
android:id="@+id/faqbtm"
android:layout_below="@+id/indicadoresbtm"
android:layout_width="fill_parent"
android:layout_height="37dp"
android:layout_marginBottom="6dp"
android:layout_marginLeft="35dp"
android:layout_marginRight="35dp"
android:adjustViewBounds="true"
android:background="@layout/btnfaq"
android:clickable="true"
android:scaleType="fitStart" />
<Button
android:id="@+id/contactobtm"
android:layout_below="@+id/faqbtm"
android:layout_width="fill_parent"
android:layout_height="37dp"
android:layout_marginBottom="6dp"
android:layout_marginLeft="35dp"
android:layout_marginRight="35dp"
android:adjustViewBounds="true"
android:background="@layout/btncontacto"
android:clickable="true"
android:scaleType="fitEnd" />
<Button
android:id="@+id/soportebtm"
android:layout_below="@+id/contactobtm"
android:layout_width="fill_parent"
android:layout_height="37dp"
android:layout_marginBottom="6dp"
android:layout_marginLeft="35dp"
android:layout_marginRight="35dp"
android:adjustViewBounds="true"
android:background="@layout/btnemergencias"
android:clickable="true"
android:scaleType="fitEnd" />
</RelativeLayout>
エラーのlogCat:
05-16 15:53:03.864: D/dalvikvm(804): GC freed 134 objects / 5968 bytes in 51ms
05-16 15:53:04.094: D/dalvikvm(804): GC freed 104 objects / 5248 bytes in 51ms
05-16 15:53:13.714: D/dalvikvm(804): GC freed 315 objects / 19056 bytes in 54ms
05-16 15:53:14.064: E/dalvikvm-heap(804): 4830936-byte external allocation too large for this process.
05-16 15:53:14.064: E/(804): VM won't let us allocate 4830936 bytes
05-16 15:53:14.064: D/AndroidRuntime(804): Shutting down VM
05-16 15:53:14.064: W/dalvikvm(804): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
05-16 15:53:14.074: E/AndroidRuntime(804): Uncaught handler: thread main exiting due to uncaught exception
05-16 15:53:14.094: E/AndroidRuntime(804): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ketanolab.banca.movil/com.ketanolab.banca.movil.soporte}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
05-16 15:53:14.094: E/AndroidRuntime(804): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.os.Handler.dispatchMessage(Handler.java:99)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.os.Looper.loop(Looper.java:123)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.app.ActivityThread.main(ActivityThread.java:4363)
05-16 15:53:14.094: E/AndroidRuntime(804): at java.lang.reflect.Method.invokeNative(Native Method)
05-16 15:53:14.094: E/AndroidRuntime(804): at java.lang.reflect.Method.invoke(Method.java:521)
05-16 15:53:14.094: E/AndroidRuntime(804): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
05-16 15:53:14.094: E/AndroidRuntime(804): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
05-16 15:53:14.094: E/AndroidRuntime(804): at dalvik.system.NativeStart.main(Native Method)
05-16 15:53:14.094: E/AndroidRuntime(804): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
05-16 15:53:14.094: E/AndroidRuntime(804): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
05-16 15:53:14.094: E/AndroidRuntime(804): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
05-16 15:53:14.094: E/AndroidRuntime(804): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.app.Activity.setContentView(Activity.java:1622)
05-16 15:53:14.094: E/AndroidRuntime(804): at com.ketanolab.banca.movil.soporte.onCreate(soporte.java:29)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
05-16 15:53:14.094: E/AndroidRuntime(804): ... 11 more
05-16 15:53:14.094: E/AndroidRuntime(804): Caused by: java.lang.reflect.InvocationTargetException
05-16 15:53:14.094: E/AndroidRuntime(804): at android.widget.LinearLayout.<init>(LinearLayout.java:92)
05-16 15:53:14.094: E/AndroidRuntime(804): at java.lang.reflect.Constructor.constructNative(Native Method)
05-16 15:53:14.094: E/AndroidRuntime(804): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
05-16 15:53:14.094: E/AndroidRuntime(804): ... 21 more
05-16 15:53:14.094: E/AndroidRuntime(804): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
05-16 15:53:14.094: E/AndroidRuntime(804): at android.graphics.Bitmap.nativeCreate(Native Method)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.graphics.Bitmap.createBitmap(Bitmap.java:468)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.graphics.Bitmap.createBitmap(Bitmap.java:435)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.content.res.Resources.loadDrawable(Resources.java:1705)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.content.res.TypedArray.getDrawable(TypedArray.java:548)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.view.View.<init>(View.java:1850)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.view.View.<init>(View.java:1799)
05-16 15:53:14.094: E/AndroidRuntime(804): at android.view.ViewGroup.<init>(ViewGroup.java:284)
05-16 15:53:14.094: E/AndroidRuntime(804): ... 25 more
05-16 15:53:14.124: I/dalvikvm(804): threadid=7: reacting to signal 3
btncontactoxmlレイアウトファイル
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/contacto" />
<item android:state_pressed="true"
android:drawable="@drawable/contactoapre" />
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/contacto" />
<item android:state_enabled="true"
android:drawable="@drawable/contacto" />
</selector>
btnbeneficios XML
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/beneficios" />
<item android:state_pressed="true"
android:drawable="@drawable/beneficiossombra" />
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/beneficios" />
<item android:state_enabled="true"
android:drawable="@drawable/beneficios" />
</selector>
btncajeros XML
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/loccajeros" />
<item android:state_pressed="true"
android:drawable="@drawable/loccajerosapre" />
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/loccajeros" />
<item android:state_enabled="true"
android:drawable="@drawable/loccajeros" />
</selector>
btnconsulta XML
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/consulta" />
<item android:state_pressed="true"
android:drawable="@drawable/consultaapre" />
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/consulta" />
<item android:state_enabled="true"
android:drawable="@drawable/consulta" />
</selector>
btnemergencias XML
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/emergencia" />
<item android:state_pressed="true"
android:drawable="@drawable/emergenciaapre" />
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/emergencia" />
<item android:state_enabled="true"
android:dr
awable = "@ drawable / emergencia" />
brnfaq XML
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/tips" />
<item android:state_pressed="true"
android:drawable="@drawable/tipssombra" />
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/tips" />
<item android:state_enabled="true"
android:drawable="@drawable/tips" />
</selector>
btnindicadores XML
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/indicadores" />
<item android:state_pressed="true"
android:drawable="@drawable/indicadoresapre" />
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/indicadores" />
<item android:state_enabled="true"
android:drawable="@drawable/indicadores" />
</selector>
btnpromo XML
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/promociones" />
<item android:state_pressed="true"
android:drawable="@drawable/promocionesapre" />
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/promociones" />
<item android:state_enabled="true"
android:drawable="@drawable/promociones" />
</selector>