Jump to content
  • Advertisement
Sign in to follow this  

Animation - shakingProblem

This topic is 2757 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey guys.
following problem:

I want to let my startbutton shake if it is not touched within 10 seconds. this lecture is out of a book i baught for starting with Android programing. But although i am thinking of havin done everything correct, the button does not shake.

buttonID = button1


<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:repeatCount="20" />

and in my main activity:

private Animation animationWackeln;
private Button startButton;
private Handler handler = new Handler();

public void onCreate(Bundle savedInstanceState) {
Button button = (Button) findViewById(R.id.button1);
animationWackeln = AnimationUtils.loadAnimation(this, R.anim.wackeln);
startButton = (Button)findViewById(R.id.button1);

private class WackleButton implements Runnable {

public void run() {


protected void onResume(){
handler.postDelayed(new WackleButton(), 1000*10);

i hope someone will help. thank you

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!