gpt4 book ai didi

android - OnAnimationEnd 不起作用,是的,我研究过

转载 作者:行者123 更新时间:2023-11-29 02:15:54 27 4
gpt4 key购买 nike

我在读一本书“Pragmatics: Hello Android”并逐字复制代码,语法都是正确的,因为我没有收到任何错误,但它没有按照我告诉它在 onAnimationEnd 上执行的操作执行。它应该带我去我的下一个 Activity ,但因为那不起作用我改变了它变成像 txtView.setText("ggag") 这样简单的东西只是为了看看它是否在执行……我注意到这本书讲述它的方式略有不同……

    Animation fadein = AnimationUtils.loadAnimation(this, R.anim.fade_in);
fadein.setAnimationListener(new AnimationListener() { /*im thinking the problem is
that it does all the work from within the setAnimationLIstener instead of like i
have seen around where the methods onAnimationEnd , onAnimationRepeat are all
done seprately outside of the
setAnimationListener(new AnimationListener() {..all work is done here??... } */
@Override
public void onAnimationEnd(Animation animation) {
//startActivity(new Intent(splahActivity.this,menuActivity.class));
//the above line of code was not working so i added the line below
//neither executes

TextView topLogo = (TextView)findViewById(R.id.lblTop);
topLogo.setText("dfsgsdfg");

}

@Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub

}

@Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub

}


});

是的,我的 onAnimationEnd 代码从未执行过 :(

最佳答案

你调用 fadein.start() 了吗?

onAnimationStart() 中的代码(例如记录消息)是否运行?

关于android - OnAnimationEnd 不起作用,是的,我研究过,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3965644/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com