可能な重複するファイル:
R cannot be resolved - Android error日食は、IDを認識していないか、または
を私はライン18及び19上にあるたエラーは、それは、ID IV1を認識しませんが、そのIDがあります私のmain.xmlファイルにあります。また、xmlファイルであり、正しく綴られているlogo_animationも認識しません。これはなぜ誰でも知っていますか?あなたはそれを追加すると、あなたがR.を輸入しているよう
package graphics.examples;
import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.widget.ImageView;
import android.graphics.drawable.AnimationDrawable;
public class graphics extends Activity {
AnimationDrawable logoAnimation;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ImageView logoImage = (ImageView) findViewById(R.id.iv1);
logoImage.setBackgroundResource(R.drawable.logo_animation);
logoAnimation = (AnimationDrawable) logoImage.getBackground();
}
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN){
logoAnimation.start();
return true;
}
else return super.onTouchEvent(event);
}
}
重複[http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error][1] [1]:http://stackoverflow.com/質問/ 885009/r-can-be-resolved-android-error – Caner