error when startanimation()
See original GitHub issueBeautiful animation. I have a problem when init call mBtLogin.startAnimation(), animation not load full in onCreate. I fix it as put startAnimation in a Handler().postdelay. How to direct call startAnimation() when start app. Thanks.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
CircularProgressButton mBtLogin = (CircularProgressButton) findViewById(R.id.progress_btn_change_activity);
mBtLogin.startAnimation();
/*new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mBtLogin.startAnimation();
}
}, 100);*/
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Animation does not play when startAnimation is called in ...
Describe the bug When calling startAnimation in a RecyclerView's onBindViewHolder, the animation does not play. This issue was partially ...
Read more >Android Animation Error - Stack Overflow
And you are using twice the animation "sol". ... setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { resim.
Read more >Animation | Jetpack Compose - Android Developers
Jetpack Compose provides powerful and extensible APIs that make it easy to implement various animations in your app's UI. This document describes how...
Read more >Animation QML Type | Qt Quick 6.4.1
Attempting to use the Animation type directly will result in an error. ... either by setting the running property to false, or by...
Read more >An Easy Error Animation for Android | HCSS Career Center
Now to apply it to a view, it's as simple as: Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.shake_error); view.startAnimation( ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@leandroBorgesFerreira, sorry to disagree, but this doesn’t require much of a fix.
onCreate()
is not supposed to be used for animating things nor explicit app logic (such as Login) as this can lead to several issues such as lagging due to early fired GC’s and others. @frankenten13, you should read about the activity lifecycle and when are you supposed to invoke certain parts of your code. Invoking a Login function duringonCreate()
is a pretty terrible design decision; you are delaying your activity creation process.As per Android documentation:
This problem was already fixed. The button accepts animation commands before the screen get drawn and waits for the right time for the animation to start.