我试图动画图像,这是我在XML文件中与动画图像,取代从OnCreat功能代码setOnClickListener功能
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false" >
<item android:drawable="@drawable/father11" android:duration="200" />
<item android:drawable="@drawable/father22" android:duration="200" />
<item android:drawable="@drawable/father33" android:duration="200" />
<item android:drawable="@drawable/father44" android:duration="200" />
<item android:drawable="@drawable/father55" android:duration="200" />
</animation-list>
,但在我的应用程序的代码,我跑动画图像时,按钮按下,但我得到sentax错误
btn_father.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
SignImage = (ImageView) findViewById(R.id.Sign);
SignImage.setImageResource(R.drawable.fatherr);
lightsAnimation=(AnimationDrawable) SignImage.getDrawable();
}
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
lightsAnimation.start();
}
});
我的链接阅读本sentece但没有理解它“(如果可以很容易地已经开始按钮或其他类型的输入),在更换主类在这个类的src树中的main.java文件“
是的,它可以很容易地启动一个按钮或其他类型的输入,请粘贴您的logcat得到实际问题 – jeet 2012-04-09 04:40:06
你是什么意思“你的logcat”? – Nada 2012-04-09 11:29:16
你得到了异常,所以粘贴在这里的位置 – jeet 2012-04-09 11:31:50