我有一個GridView
動畫的重新啓動動畫。當我們啓動activity
animation
工作時,如果我們轉到其他活動,那麼我需要動畫以與啓動時相同的方式重新啓動。現在當按下「後退」按鈕時,它將轉到上一個活動,但上述GridView
沒有動畫。下面是代碼:當onBackPressed()
CustomGrid adapter = new CustomGrid(Grids.this, web, imageId);
grid = (GridView) findViewById(R.id.grid);
grid.setAdapter(adapter);
Animation animation = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.grid_item_anim);
controller = new GridLayoutAnimationController(animation, .2f, .2f);
grid.setLayoutAnimation(controller);
在活動的onResume()中執行此操作。 – SripadRaj