English 中文(简体)
为什么我不叫AnimationEnd?
原标题:Why isn t my Android animation not calling my onAnimationEnd?

我的估算工作在read子结束之时,即下一颗屏幕火的用意,但从 an灭起,它赢得了大火。 我把所有<条码>的标识条目(仅填在清单中),但无标记。

public class PromoActivity extends Activity implements AnimationListener {
    protected boolean _active = true;
    protected int _splashTime = 5000; // time to display the splash screen in ms

    private static final float ROTATE_FROM = 0.0f;
    private static final float ROTATE_TO = -10.0f * 360.0f;// 3.141592654f * 32.0f;
    private static final String TAG = "PromoActivity";

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

        Thread promoThread = new Thread() {
            @Override
            public void run() {
                try {
                    ImageView favicon = (ImageView) findViewById(R.id.favicon);

                    RotateAnimation r; // = new RotateAnimation(ROTATE_FROM, ROTATE_TO);
                    r = new RotateAnimation(ROTATE_FROM, ROTATE_TO, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
                    r.setDuration((long) 2*1500);
                    favicon.startAnimation(r);

                    RotateAnimation q;
                    q = new RotateAnimation(ROTATE_FROM, -ROTATE_TO, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
                    q.setDuration((long) 2*1500);
                    q.setRepeatCount(0);
                    TextView mobiText = (TextView) findViewById(R.id.logotext_mobi);
                    mobiText.startAnimation(q);

                    TextView dawgText = (TextView) findViewById(R.id.logotext_bob);
                    dawgText.startAnimation(q);

                    int waited = 0;
                    while (_active && (waited < _splashTime)) {
                        sleep(100);
                        if (_active) {
                            waited += 100;
                        }
                    }
                } catch (InterruptedException ex) {

                } finally {
                    finish();
                    startActivity(new Intent("com.mobibob.promo.AboutActivity"));
                    stop();
                }
            }
        };
        promoThread.start();

    }

    @Override
    public void onAnimationEnd(Animation animation) {
        Log.d(TAG, "onAnimationEnd");
        startActivity(new Intent("com.mobibob.promo.AboutActivity"));
    }
}
最佳回答

页: 1 你们需要打电话<条码>r.setAnimationListener(PromoActative.this)和(或)<条码>。

想到的是,你有两点ations,可能不会完全同时结束。 因此,你可能希望随时了解,在本应结束的传闻数量达到时,需要多少次邀请你的听众,并且只打上<>条码>。

问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签