draw circle and fill color in android without using canvas
<p>I am using Android Studio 2.1.2 for creating android applications. In my application, I need to create a circle filled with red color in android view. I tried it by using a canvas like,</p>

<pre><code>protected void onDraw(Canvas canvas) {
            super.onDraw(canvas);
            int x = getWidth();
            int y = getHeight();
            int radius = x / 2;
            Paint paint = new Paint();
            paint.setStyle(Paint.Style.FILL);
            paint.setColor(Color.WHITE);
            paint.setStrokeWidth(2);
            canvas.drawPaint(paint);
            paint.setColor(Color.parseColor("#CD5C5C"));
            canvas.drawCircle(x / 2, y / 2, radius, paint);
        }
</code></pre>

<p>And in <code>onCreate()</code>, I have added,</p>

<pre><code>setContentView(new SampleView(this));
</code></pre>

<p>Where <code>SampleView</code> is a class which contains <code>onDraw()</code>. Is there any alternative way to do the same thing, without using the <code>canvas</code>?</p>