title: Bitmap.getPixel always returning black
body: <p>I'm creating an app which involves getting the color of part of the screen.
  To do this I am using the Bitmap.getPixel method to retrieve a specified pixel of the screen, than I am converting it to RGB format to make it easier for me to code with later. The issue is no matter what is on the screen when i use the getPixel method, it always returns the same RGB values, R:0 G:0 B:0, or Black, even when there is a gray button covering up the entire screen! Here is the code</p>
  
  <pre><code>package proof.of.concept;
  
  import android.app.Activity;
  import android.graphics.Bitmap;
  import android.graphics.Color;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.Display;
  import android.view.View;
  import android.widget.*;
  public class ColorCheckerProofOfConcept extends Activity {
      private static final String TAG = "ColorChckerProofOfConcept:: ";  
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          final Button button = (Button) findViewById(R.id.button1);
  
       button.setOnClickListener(new View.OnClickListener() {
           public void onClick(View v) {
               Display display = getWindowManager().getDefaultDisplay();
                  int width = display.getWidth();
                  int height = display.getHeight();
                     Log.d(TAG, "Width and Height Retrieved As: " + width + ", " + height);
                  Bitmap b = Bitmap.createBitmap(width, height, Bitmap.Config. RGB_565);
                  String hexValue;
  
                   int test;
                test = b.getPixel(240, 350);
  
               hexValue = Integer.toHexString(test);
               Log.d(TAG, "pixel at 100, 200 succesfully retreived! with value of: " + test);
               Log.d(TAG, "and an Hex value of: " + hexValue);
               int blue = Color.blue(test);
               int red = Color.red(test);
               int green = Color.green(test);
  //this is a modification
  
                 Log.d(TAG, "RGB COLOR! R:" + red + " G:" + green + " B:" + blue);
           }
       });
     }
  }
  </code></pre>