Android waiting for rotation circle animation

Source: Internet
Author: User

First create an animated XML file as follows

<?xml version= "1.0" encoding= "Utf-8"?>

<animation-list xmlns:android= "Http://schemas.android.com"

Android:oneshot= "false" ><!--set to False is the animation does not loop play--! >

<item

android:drawable= "@drawable/loading_01"

android:duration= "></item>"

<item

android:drawable= "@drawable/loading_02"

android:duration= "></item>"

<item

android:drawable= "@darwable/loading_03"

android:duration= "></item>"

</animation-list>

This is an animated effect. If you set this animation effect on a imageview, each picture will appear in turn to create an animation

Then we'll look at the class that loads the animation

mloadingimagebiew= (ImageView) Findviewbyid (R.id.loadingimageview);

Animationdrawable animationdrawable= (animationdrawable) this.getresources (). Getdrawable (R.drawable.loading_ animation_drawable);

Mloadingimageview.setimagedrawable (animationdrawable);

Animationdrawable.start ();

Animated effect turned on

After the animation is done we want to jump to the next interface to see below:

New Thread (New Runnable () {

public void Run () {

Handler.post (New Runnable () {

public void Run () {

StartActivity (New Intent (Mainactivity.this,userlistactivity.class));

Finish ();

}

);

});

Android waiting for rotation circle animation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.