我試圖動畫圖像,這是我在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