I am trying to start voice recognition on a touch but the issue is OnTouchListener is not called when user touches the screen

I tried to put breakpoint in function but it does not come in function at all

On my laptop the Logcat is not working so I cant use log and thus using a toast to see if the function is called.

Code is as below. can anyone please help why this function is not called on touch??

Updated:

I am calling setOnTouchListener in OnCreate and now after using view my application is crashing on startup.

```
View view = findViewById(R.layout.voice_recog);
    view.setOnTouchListener(new View.OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            // TODO Auto-generated method stub
            Toast toast = Toast.makeText(getApplicationContext(),"Touch recognised",Toast.LENGTH_LONG);
            toast.show();
            startVoiceRecognitionActivity();

            return false;
        }
    });

```

I found that the issue is regarding assigning the view...Application is crashing because of source not found error...on line

```
    View view = findViewById(R.layout.voice_recog);
    //crashes on below line ....with Source not found error
    view.setOnTouchListener(new View.OnTouchListener() {

```