So I want to create a library that use custom view. I want to inherit View class, but it's error because my minsdk is 19. I need my library to support sdk 19. Is there a way to solve this?
class Dummy() : View(context, attrs, defStyleAttr, defStyleRes) {
You should use another constructor for this. The one you used is available only from the API 21.
For custom views I use it like this:
class Dummy @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0)
: View(context, attrs, defStyleAttr)
So 2 things here: