Can we have two canvases in an activity ? (OR) Having a canvas outside the onDraw() is not working
问题 @Override protected void onDraw(Canvas canvas) { // Draw graphic objects ..... } public void displayCalc(){ //Do some calculation & display results near these graphic objects String result = String.valueOf(value); //Do some calculation //Display Calculated values Canvas c =new Canvas(); Paint paint = new Paint(); paint.setStyle(Paint.Style.FILL); paint.setAntiAlias(true); paint.setColor(Color.WHITE); c.drawText(result,200,300,paint); } But if i have the same thing in the function onDraw it