私のプログラム(実際には私のものではありません。このバグを修正しようとしているだけです)は、ほとんどの電話で正常に動作しますが、Sony Xperia Pでは起動しません。
プログラムを起動すると、次のメッセージが表示されます。
アプリケーションが予期せず停止しました。
アプリには、この携帯電話にはランチャー アイコンもありません (デフォルト アイコンのみ)。
エラーログには次のように書かれています:
java.lang.RuntimeException: unable to start Activity
android.view.InflateException: Binary XML file line #16: error inflating class android.view.ImageView
アプリが呼び出されたときにエラーメッセージが表示されました:
setContentView(R.layout.menu_0_splash);
ドローアブル リソースが次の解像度で定義されていることに気付きました。
1024x600 320x240 400x240 480x320 800x480 854x480
この電話は 960x540 なので、デフォルトのリソースもあるはずです。
何が問題なのですか?
レイアウト ファイル (コピー/貼り付け):
<?xml version = "1.0"
encoding = "utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/m0_relativeLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/gradient_green" >
<ImageView #this is the problematic line
android:id="@+id/arrow_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/m0_arrow_top_margintop"
android:src="@drawable/splash_arrow_top" />
<ImageView
android:id="@+id/arrow_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="@dimen/m0_arrow_bottom_marginbottom"
android:src="@drawable/splash_arrow_bottom" />
<ImageView
android:id="@+id/belt_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="@drawable/splash_belt_top" />
<ImageView
android:id="@+id/belt_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:src="@drawable/splash_belt_bottom" />
<ImageView
android:id="@+id/t_ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:adjustViewBounds="true"
android:src="@drawable/t_ad" />
<ImageView
android:id="@+id/title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/t_ad"
android:adjustViewBounds="true"
android:src="@drawable/splash_title" />
</RelativeLayout>