title: Android not drawing anything on canvas
body: <p>I am having some trouble getting Android to draw on the screen. I've debugged this and nothing seems to be off. The screen just shows a black background. There are no error messages or anything.</p>
  
  <pre><code>    public class GameView extends View {
  
      MazePanel mazePanel;
      MazePanel mazePanel2;
      Bitmap bmap;
      Paint paint;
  
  
      public GameView(Context context) {
          super(context);
          mazePanel = new MazePanel(context.getApplicationContext());
          mazePanel2 = new MazePanel(context.getApplicationContext());
          paint = new Paint();
          paint.setStyle(Paint.Style.FILL);
      }
  
      @Override
      protected void onDraw(Canvas canvas) {
              bmap = mazePanel.getBitmap();
              mazePanel.fillGraphicsOval(100, 100, 100, 100);
              canvas.drawBitmap(bmap, 0, 0, paint);
      }
  </code></pre>
  
  <p>Here is MazePanel</p>
  
  <pre><code>    public class MazePanel extends View {
  
      private int color;
      private Bitmap bmap;
      private Canvas canvas;
      private Paint paint;
      private Path polyPath;
  
      private DisplayMetrics metrics;
  
      private int viewWidth;
      private int viewHeight;
  
      public enum Colors {
          BLACK, GRAY, DARK_GRAY, WHITE, YELLOW, RED
      };
  
      public MazePanel(Context context) {
          super(context);
          metrics = context.getResources().getDisplayMetrics();
          viewWidth = metrics.widthPixels;
          viewHeight = metrics.heightPixels;
          bmap = Bitmap.createBitmap(viewWidth, viewHeight, Config.RGB_565);
          canvas = new Canvas(bmap);
          paint = new Paint();
          polyPath = new Path();
      }
  
      public void initbmap() {
          bmap = Bitmap.createBitmap(viewWidth, viewHeight, Config.RGB_565);
      }
  
      public Canvas getCanvas() {
          return canvas;
      }
  
      public void setCanvas(Canvas canvas) {
          this.canvas = canvas;
      }
  
      public void setGraphicsColor(Colors colors) {
          switch(colors) {
          case BLACK:
              paint.setColor(Color.BLACK);
              break;
          case GRAY:
              paint.setColor(Color.GRAY);
              break;
          case DARK_GRAY:
              paint.setColor(Color.DKGRAY);
              break;
          case WHITE:
              paint.setColor(Color.WHITE);
              break;
          case YELLOW: 
              paint.setColor(Color.YELLOW);
              break;
          case RED:
              paint.setColor(Color.RED);
              break;
          default:
              break;
          };
      }
  
      public void setGraphicsColor(int color) {
          paint.setColor(color);
      }
  
      public void setGraphicsColor(int r, int g, int b) {
          paint.setColor(Color.argb(100, r, g, b));
      }
  
      public void fillGraphicsRect(int x, int y, int width, int height) {
          canvas.drawRect(x, y, x + width - 1, y + height - 1, paint);
      }
  
      public void fillGraphicsPolygon(int[] xps, int[] yps, int numPoints) {
          polyPath.reset();
          polyPath.moveTo(xps[0], yps[0]);
          for (int i = 1; i &lt; numPoints; i++) {
              polyPath.lineTo(xps[i], yps[i]);
          }
          polyPath.close();
          canvas.drawPath(polyPath, paint);
      }
  
      public void fillGraphicsOval(int x, int y, int width, int height) {
          canvas.drawOval(new RectF(x, y, x + width - 1, y + height - 1), paint);
      }
  
      public void drawGraphicsLine(int x, int y, int fx, int fy) {
          canvas.drawLine(x, y, fx, fy, paint);
      }
  
      public int createNewColor(int color) {
          this.color = color;
          return color;
      }
  
      public int createNewColor(int r, int g, int b) {
          return Color.rgb(r, g, b);
      }
  
      public int getColor() {
          return color;
      }
  
      public Bitmap getBitmap() {
          return bmap;
      }
  
      public void setBitmap(Bitmap bitmap) {
          bmap = bitmap;
      }
  
      public void paint(Canvas canvas) {
          if (bmap == null)
              initbmap();
          canvas.drawBitmap(bmap, 0, 0, null);
      }
  
      public void update() {
          paint(getCanvas());
      }
  }
  </code></pre>
  
  <p>I apologize for posting so much code, but I can't seem to find anything wrong. When debugging, the onDraw method executes, <code>bmap</code> gets referenced to <code>mazePanel</code>'s bitmap. So either <code>fillGraphicsOval</code> is not working or <code>canvas.drawBitmap()</code> is not the right method to call. </p>