[Solved] How to pass data from activity to class in android? [closed]

Create a class for your requirement as CustomView and define public method to pass integer value and use it there. As I have created setIntValue(). public class CustomView extends View { private int mIntValue; public CustomView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public CustomView(Context context, AttributeSet attrs) { this(context, attrs, 0); … Read more