I have created a fragment in which an animation for rotation is there.
Animation rotation = AnimationUtils.loadAnimation(getContext(), R.anim.rotate);
When loading the fragment for the first time the animation is finely loaded.
But when coming back to the activity from another activity using intent, it loading the activity fine, loading the fragment fine but giving
Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
pointing
Animation rotation = AnimationUtils.loadAnimation(getContext(), R.anim.rotate);
Please help. Thanks in advance.