Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - animation drawable

animation drawable

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

animation drawable

Postby kitox321 » Fri Jun 08, 2012 8:11 pm

hi there, i am a newbie in android dev...So I want my animation to start as soon as the activity is created, but for some reason no matter what I try will get it to start, it wont...

Here's what I have and how do I get this to work?



import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

public class Game extends Activity {
AnimationDrawable roadAnimation;

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.game);

ImageView roadImage = (ImageView) findViewById(R.id.roadimage);
roadImage.setBackgroundResource(R.drawable.roadanimation);
roadAnimation = (AnimationDrawable) roadImage.getBackground();

Button startbutton = (Button) findViewById(R.id.sgame_btn);

startbutton.setOnClickListener(new Button.OnClickListener(){

public void onClick(View arg0) {

// TODO Auto-generated method stub


roadAnimation.start();

}
});
kitox321
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Jun 08, 2012 7:40 pm

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests