Issue
I have a wear Activity that has a button. When clicked the method below is run:
public void success(View view) {
Intent intent = new Intent(this, ConfirmationActivity.class);
intent.putExtra(ConfirmationActivity.EXTRA_ANIMATION_TYPE,
ConfirmationActivity.SUCCESS_ANIMATION);
intent.putExtra(ConfirmationActivity.EXTRA_MESSAGE, "Success!");
startActivity(intent);
finish();
}
The confirmation animation shows up but for a few seconds. When I include the finish() line to close current Activity it last even shorter... Any ideas on how to show the confirmation for more time? Or any other way to finish current activity that will allow the confirmation last longer?
Thanks!
Solution
The confirmation animation is handled by the OS, so I dont think you can change the duration.
Inside the ConfirmationActivity class, there is private member variable private static final long SUCCESS_MESSAGE_DELAY_MS = 50L; However this variable is private final, so you can not change. Also, this variable is used to delay the appearance of confirmation, so it is not useful for duration. In addition, the private static long getAnimationDuration(android.graphics.drawable.AnimationDrawable animation) is private, so you are not even supposed to know how long the animation exactly.
When calling the finish() on an activity, you just telling the OS that your current activity is about to finish. It doesnt help you make the duration last longer. Your current activity will eventually be shown after the confirmation animation is finished.
Answered By - ztan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.