Reputation: 543
I want to use animation on an Image Button in my fragment what argument should I use instead of activity ("this)?
pause.startAnimation(AnimationUtils.loadAnimation(this, android.R.anim.fade_out));
Upvotes: 0
Views: 64
Reputation: 75778
You should use getActivity()
.
Return the Activity this fragment is currently associated with.
startAnimation(AnimationUtils.loadAnimation(getActivity(), android.R.anim.fade_out));
Upvotes: 3