I am a beginner in android, and I was going through thenewboston tutorials. I came across this code for gesture recognition.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myMessage = (TextView) findViewById(R.id.myMessage);
this.gestureDetector = new GestureDetectorCompat(this, this);
gestureDetector.setOnDoubleTapListener(this);
}
I looked up the documentation for GestureDetectorCompat
, and could see that the constructor used was GestureDetectorCompat(Context context, GestureDetector.OnGestureListener listener)
However, I couldn't understand how new GestureDetectorCompat(this, this);
will create this object. What is the (this, this)
referring to? Where is it getting from? Is there another way to create this object that could help me understand this?