2011-09-09 20 views
1

工作我正在使加載在工作的罰款與任何真實的設備Emulater..Its動畫..動畫不Emulater

public class MainActivity extends Activity { 

    private ImageView imgView; 
    private Animation animation; 

    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.main); 

     animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.grow); 
     animation.setRepeatCount(50); // Repeat animation infinitely 
     animation.setRepeatMode(Animation.REVERSE); 

     imgView = (ImageView) findViewById(R.id.imgView); 
     imgView.setOnClickListener(new OnClickListener() { 

      @Override 
      public void onClick(View v) { 
       // TODO Auto-generated method stub 


       imgView.startAnimation(animation);  



       new Handler().postDelayed(new Runnable() { 
        public void run() { 

         Intent it = new Intent(getApplicationContext(), MyWebView.class); 
         startActivity(it); 

        } 
       }, 5000); 


      } 
     }); 
    } 

和我的動畫XML文件以下

<rotate 
xmlns:android="http://schemas.android.com/apk/res/android" 
      android:fromDegrees="0" 
      android:toDegrees="360" 
      android:pivotX="50%" 
      android:pivotY="50%" 
      android:duration="50" /> 
+0

在logcat中獲取任何錯誤 – blessenm

+0

nope .. !!沒有錯誤。有時只是滑動效果..但沒有完全工作 –

回答

1

我想你可能已禁用動畫在模擬器: 檢查:

設置>顯示>動畫..

希望可以幫助你的問題

+0

我檢查..但它已經ON..m得到三個選項「無動畫」,「一些動畫」和「所有動畫」...並在「所有動畫「 –

+0

你可以嘗試創建一個新的AVD/.... –