mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
eb13ddc00c
commit
f8a84a763b
1 changed files with 9 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue