Created
August 6, 2017 18:06
-
-
Save robillo/c5f7cc0ccfa3c04bfd26e0d2ee3052d6 to your computer and use it in GitHub Desktop.
MyCustomView class extending View class, with constructor matching super
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.robillo.customviewstutorial; | |
import android.content.Context; | |
import android.os.Build; | |
import android.support.annotation.Nullable; | |
import android.support.annotation.RequiresApi; | |
import android.util.AttributeSet; | |
import android.view.View; | |
/** | |
* Created by robinkamboj on 06/08/17. | |
*/ | |
public class MyCustomView extends View{ | |
public MyCustomView(Context context) { | |
super(context); | |
} | |
public MyCustomView(Context context, @Nullable AttributeSet attrs) { | |
super(context, attrs); | |
} | |
public MyCustomView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { | |
super(context, attrs, defStyleAttr); | |
} | |
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) | |
public MyCustomView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) { | |
super(context, attrs, defStyleAttr, defStyleRes); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment