ServoView: Add default constructor.

Android's `View` has multiple constructors. Currently only `ServoView(Context, AttributeSet)` is available.
This constructor is usually used by Android when inflating a View from a layout XML file. However when
creating the `View` in code no `AttributeSet` is available.
This commit is contained in:
Sebastian Kaspari 2018-10-08 16:04:02 +02:00
parent eb13ddc00c
commit f8a84a763b
No known key found for this signature in database
GPG key ID: 9A155D346A1C25FA

View file

@ -60,8 +60,17 @@ public class ServoView extends GLSurfaceView
private boolean mRedrawing;
public ServoView(Context context) {
super(context);
init(context);
}
public ServoView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
private void init(Context context) {
mActivity = (Activity) context;
setFocusable(true);
setFocusableInTouchMode(true);