manolazo
22/04/13, 00:35:29
Buenas, estoy jugando un poco con la clase ObjectAnimator pero hay cosas que no salen o no entiendo muy bien.
Un ejemplo es este codigo el cual me da un error Fatal exception main:
java.lang.NosuchFieldError: android.view.View.ALPHA
public class PropertyAnimations extends Activity{
CheckBox mCheckBox;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final Button alphaButton = (Button) findViewById(R.id.alphaButton);
ObjectAnimator alphaAnimation = ObjectAnimator.ofFloat(alphaButton,
View.ALPHA, 0);
alphaAnimation.setRepeatCount(1);
alphaAnimation.setRepeatMode(ValueAnimator.REVERSE );
alphaAnimation.start();
}
}
Un saludo.
EDITO:
Hola,
Es curioso, si ejecuto la aplicacion con el AVD me da el error indicado, pero si uso el galaxy s3 me corre sin problemas. ¿ A que se debe?
Un ejemplo es este codigo el cual me da un error Fatal exception main:
java.lang.NosuchFieldError: android.view.View.ALPHA
public class PropertyAnimations extends Activity{
CheckBox mCheckBox;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final Button alphaButton = (Button) findViewById(R.id.alphaButton);
ObjectAnimator alphaAnimation = ObjectAnimator.ofFloat(alphaButton,
View.ALPHA, 0);
alphaAnimation.setRepeatCount(1);
alphaAnimation.setRepeatMode(ValueAnimator.REVERSE );
alphaAnimation.start();
}
}
Un saludo.
EDITO:
Hola,
Es curioso, si ejecuto la aplicacion con el AVD me da el error indicado, pero si uso el galaxy s3 me corre sin problemas. ¿ A que se debe?