title: Android tired with fragment
body: <p>i have extended a fragment named 'DetailFragment' from home activity.But i cannot access the functions of activity in fragment class,like animation,tablayout,and any other functions which i did in activity.But when i change fragment to fragment activity every error getting cleared,But i need fragment only.</p>
  
  <p>Here is my code</p>
  
  <pre><code>     public class DetailFragment extends Fragment {
  
      @Override
      public View onCreateView(LayoutInflater inflater,ViewGroup container, Bundle args) {
          View view = inflater.inflate(R.layout.activity_detail, container, false);
  </code></pre>
  
  <p>getting error @ 'loadanimation'</p>
  
  <pre><code> Animation animationFadeIn = AnimationUtils.loadAnimation(this,R.anim.fadein);
              Animation animationFadeOut = AnimationUtils.loadAnimation(this,R.anim.fadeout);
  </code></pre>
  
  <p>getting error @ 'onTouchEvent'</p>
  
  <pre><code>      public boolean onTouchEvent(MotionEvent event) {
          mGestureDetector.onTouchEvent(event);
  
          return super.onTouchEvent(event);
          return view;
      }
  </code></pre>
  
  <p>}</p>
  
  <p>i need to know that is it possible to work on fragment like we works on activity or is there any functions like 'getActivity' method to access activity class,and how i can implement it. that's enough. thank you in advance programmers..</p>