title: Can't click buttons under a View acting as an overlay
body: <p>I'm working on an app which has a View overlayed on the screen to act as a colour tint on the screen. I've got the view to come up in the colour I want and I can see buttons behind it.. the problem is I can't click them! :(</p>
  
  <p><strong>Here's what the app has achieved on the screen (this is how I want it to look):</strong></p>
  
  <p><a href="https://i.stack.imgur.com/fGnoL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fGnoL.png" alt="Notice the yellow tinge"></a></p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>import android.app.Service;
  import android.content.Intent;
  import android.graphics.Color;
  import android.graphics.PixelFormat;
  import android.os.IBinder;
  import android.view.Gravity;
  import android.view.View;
  import android.view.WindowManager;
  
  public class OverlayService extends Service {
      private WindowManager windowManager;
      private View filter;
  
      @Override
      public IBinder onBind(Intent intent) {
          // Not used
          return null;
      }
  
      @Override public void onCreate() {
      super.onCreate();
  
      windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
  
      filter = new View(this); // Create a new view
      float alpha = (float) 0.8; // Create alpha variable
      filter.setAlpha(alpha); // Set alpha (this doesn't seem to do anything)
      filter.setBackgroundColor(Color.YELLOW); // Set the background colour to yellow
      filter.getBackground().setAlpha(80); // Set the background's alpha (this is the call that works!)
  
      WindowManager.LayoutParams params = new WindowManager.LayoutParams(
          WindowManager.LayoutParams.WRAP_CONTENT,
          WindowManager.LayoutParams.WRAP_CONTENT,
          WindowManager.LayoutParams.TYPE_PHONE,
          WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
          PixelFormat.TRANSLUCENT);
  
      params.gravity = Gravity.TOP | Gravity.LEFT;
      params.x = 0;
      params.y = 100;
  
      windowManager.addView(filter, params);
    }
  
    @Override
    public void onDestroy() {
      super.onDestroy();
      if (filter != null) windowManager.removeView(filter); // If the filter exists, remove it
    }
  
  }
  </code></pre>
  
  <p>Cheers!</p>