ScratchView
ScratchView copied to clipboard
set multiple random background image from drawable -> Exception
images randoms:ArrayListOf = [R.drawable.a,R.drawable.b,etc..] R = random.nextInt(2)
Hey, trying to scratch.setBackroundResource(imageRandom[R] but I got a crash ... why?
The crash is from your method:
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawBitmap(mScratchBitmap, 0, 0, mBitmapPaint);
canvas.drawPath(mErasePath, mErasePaint);
}