title: Touch Event Missed
body: <p>Q. I am trying to capture touch events in code, they appear to work but do not catch the first touch of the screen?</p>
  
  <p>Below is the log printout, it knows about the touch but its not allowing me to capture it? any help would be much appreciated.   </p>
  
  <p>I have included the code for the ontouch event, onCreate and the setViewFeatures:</p>
  
  <p>At the top of the activity I have </p>
  
  <pre><code>    public class MediaActivity extends Activity implements OnCompletionListener, OnErrorListener,   OnInfoListener,
      OnPreparedListener, OnSeekCompleteListener, OnTouchListener, OnVideoSizeChangedListener,
      SurfaceHolder.Callback, MediaController.MediaPlayerControl
  
      @Override
      public void onCreate(Bundle savedInstanceState)
      {
  
      super.onCreate(savedInstanceState);
  
      setViewFeatures();
  
      setSessionData();
  
      setContentView(R.layout.activity_media);
  
  
  
      setProgressBar();
  
      createPADialog();
  
      setDRMListeners();
  
      setClientAndServer();
  
      setButtonListeners();
  
      // Might use this for getting ref. for grabbing view when its first
      // displayed...
      // View v =
      // getWindow().getDecorView().findViewById(android.R.id.content);
  
      try
      {
  
          setSurfaceView();
  
      }
      catch (Exception e)
      {
          errorLevel = ERRORS.CRITICAL;
          callError("UNABLE TO RUN MediaActivity", errorLevel);
      }
  
      }
  
      private void setViewFeatures()
      {
  
  
      requestWindowFeature(Window.FEATURE_NO_TITLE);
  
      int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION 
                    | View.SYSTEM_UI_FLAG_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION 
                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN 
                    | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
  
      View decorView = getWindow().getDecorView();
      decorView.setSystemUiVisibility(uiOptions);
  
      int flags = WindowManager.LayoutParams.FLAG_FULLSCREEN 
                | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
                | WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING
                | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED 
                | WindowManager.LayoutParams.FLAG_FULLSCREEN;
  
      getWindow().addFlags(flags);
  
      }
  
      @Override
      public boolean onTouch(View v, MotionEvent event)
      {
  
      Log.d("TAG", "In onTouch ");
      try
      {
          if (event.getAction() == MotionEvent.ACTION_DOWN)
          {
              if (topBar.isOpened())
              {
                  callCloseBars();
              }
              else
              {
                  callOpenBars();
              }
          }
      }
      catch (Exception e)
      {
          Log.d("TAG", e.getMessage());
      }
  
           return true;
      }
  
  
      10-14 07:33:09.900: I/InputReader(192): Touch event's action is 0x0 (deviceType=0) [pCnt=1, pending(waiting finished signal)=0, s=0.80 ]
      10-14 07:33:09.910: I/InputDispatcher(192): Delivering touch to current input target: action: 0x0
      10-14 07:33:09.910: I/InputDispatcher(192): Delivering touch to current input target: action: 0x0
      10-14 07:33:09.910: D/InputDispatcher(192): [drainOutboundQueueLocked] initialize cntPair(sender-receiver)
      10-14 07:33:09.910: I/InputQueue-JNI(192): Sending finished signal for input channel 'hidden nav  (client)' since it is being unregistered while an input message is still in progress.
      10-14 07:33:09.910: I/InputQueue-JNI(192): Ignoring finish signal on channel that is no longer registered.
      10-14 07:33:09.910: I/PowerManagerService(192): Ulight 3-&gt;7|0
      10-14 07:33:09.910: D/PowerManagerService(192): setLightBrightness : mButtonLight : 255
      10-14 07:33:10.060: D/Tethering(192): getTetheredIfacePairs
      10-14 07:33:10.080: I/InputReader(192): Touch event's action is 0x1 (deviceType=0) [pCnt=1,    pending(waiting finished signal)=0, s=]
  </code></pre>