title: setOnTouchListener not working for android Fragment
body: <p>I am using <code>TabView</code> and in it, I am using <code>Fragment</code> to load each tab. I want to get the <code>Touch</code> event when the user touches any of the fragments.</p>
  <p><strong>Fragment Code</strong></p>
  <pre><code> public MobileBankingFragment() {
      // Required empty public constructor
  }
  
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      context = (FragmentActivity) super.getActivity();
      view = inflater.inflate(R.layout.fragment_mobile_banking, container, false);
      alarm = new TimerReceiver();
      init(view);
      touchListener(view);
      return view;
  }
  
  private void touchListener(View view) {
      layout= (FrameLayout) view.findViewById(R.id.fragmentMobileBanking);
      layout.setOnTouchListener(new View.OnTouchListener() {
          @Override
          public boolean onTouch(View v, MotionEvent event) {
              Toast.makeText(context, &quot;you just touch the screen :-)&quot;, Toast.LENGTH_SHORT).show();
              return true;
          }
      });
  
  
      view.setOnTouchListener(new View.OnTouchListener() {
          @Override
          public boolean onTouch(View v, MotionEvent event) {
              Toast.makeText(context, &quot;you just touch the screen :-)&quot;, Toast.LENGTH_SHORT).show();
              startTheTimerForTenSecond();
              return true;
          }
      });
  }
  </code></pre>
  <p>Here I try to get the touch event in two ways, one by event, another by the id of the layout, but I have had no luck. This code gives no errors, but no output either.</p>