title: On click listener doesn't work
body: <pre><code>public class ChatHeadDrawerService extends Service {
  
        private WindowManager windowManager;
        private ImageButton chatHead;
  
        @Override public IBinder onBind(Intent intent) {
          // Not used
          return null;
        }
  
        @Override public void onCreate() {
          super.onCreate();
  
          windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
  
          chatHead = new ImageButton(this);
          chatHead.setImageResource(R.drawable.x);
  
         chatHead.setOnClickListener(new OnClickListener() {
              // Start new list activity
              public void onClick(View v) {
                  Intent mainIntent = new Intent(ChatHeadDrawerService.this,
                          MainActivity.class);
                  startActivity(mainIntent);
              }
          });
  
  
          final 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(chatHead, params);
  
  
          chatHead.setOnTouchListener(new View.OnTouchListener() {
  
  
  
                private int initialX;
                private int initialY;
                private float initialTouchX;
                private float initialTouchY;
  
                @Override public boolean onTouch(View v, MotionEvent event) {
  
  
                  switch (event.getAction()) {
                    case MotionEvent.ACTION_DOWN:
                      initialX = params.x;
                      initialY = params.y;
                      initialTouchX = event.getRawX();
                      initialTouchY = event.getRawY();
                      return true;
                    case MotionEvent.ACTION_UP:
                      return true;
                    case MotionEvent.ACTION_MOVE:
                      params.x = initialX + (int) (event.getRawX() - initialTouchX);
                      params.y = initialY + (int) (event.getRawY() - initialTouchY);
                      windowManager.updateViewLayout(chatHead, params);
                      return true;
                  }
                  return false;
                }
          });
        }
  </code></pre>
  
  <p>On click listener doesn't work  in chat head but chat head work correctly and move all over the screen i want to open intent when click on the chat head thanks for helping ......................</p>
  
  <p>this the line that doesnt work </p>
  
  <pre><code> chatHead.setOnClickListener(new OnClickListener() {
              // Start new list activity
              public void onClick(View v) {
                  Intent mainIntent = new Intent(ChatHeadDrawerService.this,
                          MainActivity.class);
                  startActivity(mainIntent);
              }
          });
  </code></pre>