I have the following CustomView I am using for painting in my app:
CustomView
package com.test.testing; import android.content.Context; import android.gra
Just do one thing always create new instance of your view class view1.paint.setColor(Color.LTGRAY);, then layout.addView(view1); means create new view it will save prevoius one also, its work for me. Very simple!!
view
view1.paint.setColor(Color.LTGRAY);
layout.addView(view1);