@Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); Rect rect = canvas.getClipBounds(); Paint paint = new Paint(); paint.setStyle(Paint.Style.STROKE); paint.setStrokeWidth(5); paint.setColor(Color.BLUE); canvas.drawRect(rect, paint); }
TextView textView = findViewById(R.id.text_view); textView.setText("Hello World!"); textView.setTextColor(Color.GREEN);The android.widget.TextView is a part of the Android Framework and can be found in the android.widget package library.