final BasicAnimatorActivity activity = getActivity(); Button button = (Button) activity.findViewById(R.id.animatingButton); mAnimator = ObjectAnimator.ofFloat(button, "translationX", 0, 100); super.setUp();