0

アプリを起動する前にスプラッシュを利用しようとしました。イメージ名は一致し、xml ファイルにも Java ファイルにもエラーは表示されません。しかし、プロジェクトにはエラーが表示されます: 指定された名前に一致するリソースが見つかりません。

  <?xml version="1.0" encoding="utf-8"?>
  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical" android:layout_width="fill_parent"
  android:layout_height="fill_parent">

  <ImageView android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:src="@drawable/splash"
          android:layout_gravity="center"/>


</LinearLayout>

スプラッシュ.java:

package com.splash;
import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.os.Handler;

 public class Splash extends Activity {
 @Override
 public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);

int secondsDelayed = 1;
new Handler().postDelayed(new Runnable() {
        public void run() {
                startActivity(new Intent(Splash.this, menu.class));
                finish();
        }
}, secondsDelayed * 1000);
 }
 }
4

1 に答える 1

0

私のアプリケーションでもこのエラーが見つかりました。私のアプリケーションでは、drawables のすべてのフォルダー (drawable-ldpi、drawable-mdpi、drawable-hdpi、drawable-xhdpi) に png 画像のコピーを作成することで問題を解決しました。これは私のアプリケーションでは正しく機能します。これで問題が解決することを願っています。

于 2013-03-13T19:53:00.280 に答える