Code example for AnimationDrawable

Methods: start

0
          imgv.setBackgroundResource(R.anim.frameanim);       /*using frame animation on click button*/
          final AnimationDrawable rckanim=(AnimationDrawable)imgv.getBackground();
          bt1.setOnClickListener(new View.OnClickListener() {   
               public void onClick(View v) {
                    // TODO Auto-generated method stub 
                    rckanim.start();
               } 
         }); 
          
	} 
	 
	@Override 
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present. 
		getMenuInflater().inflate(R.menu.appresources, menu);
		getMenuInflater().inflate(R.menu.menus,menu);        /*USE OF MENU RESOURCES*/
	 
		return true; 
	} 
 
}