¿Cómo hacer la animación predeterminada del cargador de Android?

Quiero hacer una animación "ocupada" de Android, con una imagen similar a la predeterminada.

Me gusta esto:

Introduzca aquí la descripción de la imagen

Si necesitas algo como esto en tu aplicación de Android, puedes usar ProgressBar . Ofrece un método setIndeterminate() que hace que muestre un círculo de hilado infinito (como el de su ejemplo).

Si se necesita otro dibujable, puede usar el método setIndeterminateDrawable() .

Si sólo desea una imagen animada de este círculo giratorio (por ejemplo, para su proceso de carga de Ajax), puede encontrar una aquí: http://www.ajaxload.info/

Sólo usa una imagen estática y gírala. Esto le dará el efecto deseado.

 ImageView image = (ImageView) findViewById(R.id.refreshicon); float ROTATE_FROM = 0.0f; // from what position you want to rotate it float ROTATE_TO = 10.0f * 360.0f; // how many times you want it to rotate in one 'animation' (in this example you want to fully rotate -360 degrees- it 10 times) RotateAnimation r = new RotateAnimation(ROTATE_FROM, ROTATE_TO, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); r.setDuration(7500); // here you determine how fast you want the image to rotate r.setRepeatCount(Animation.INFINITE); // how many times you want to repeat the animation r.setInterpolator(new LinearInterpolator()); // the curve of the animation; use LinearInterpolator to keep a consistent speed all the way image.startAnimation(r); 

Es FrameAnimation.

Puede consultar este artículo para saber cómo crearlo: http://yekmer.posterous.com/how-to-make-a-loading-animator-in-android

FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.