title: How to get pixel color in Android?
body: <p>I have set a PNG image(image having transparent background) as button background, When I touch the button it shows me X-coordinate and Y-coordinate of the button’s touched position but, I want to know pixel color of the touched position of the button.</p>
  
  <p>Actually I want to know whether the touched position is transparent area of the button or colored area of the button.  You can check my code that I have developed for this purpose.  Please help me in this respect; your help would be cordially appreciated. </p>
  
  <pre><code> button.setOnTouchListener(new OnTouchListener() 
          {
              public boolean onTouch(View v, MotionEvent event) 
              {
  
                  int x_coordinate  = (int)event.getX(); 
                  int y_coordinate = (int)event.getY(); 
  
              //int color = Bitmap.getPixel(x,y);
  
              if (event.getAction() == MotionEvent.ACTION_DOWN) 
                  {
                  }
  
              if (event.getAction() == MotionEvent.ACTION_UP) 
                  {
                  }
  
                  return true;
              }
          });
  </code></pre>