First of all, as a chemist, I love these tutorials and this is a great community.
On to my question
In the tutorial specified we have the following piece of code under the OnCreate() method in the MainActivity class:
this.gestureDetector= new GestureDetectorCompat(this,this);
I've done some work on the keyword, and I'd like to ask whether this could be expanded to:
MainActivity.gestureDetector= new GestureDetectorCompat(MainActivity,MainActivity);
If so, are we saying that the gestureDetector object for this instance of MainActivity is the same as creating object of class GestureDetectorCompat with arguments of MainActivity, MainActivity?
I thought this could only be used to refer to variables outside the class? Or to pass info from overloaded constructors to other ones.
And what's up with the arguments? I thought GestureDetectorCompat takes a Context and a listener?
I've gone through all the other posts on the subject but am still confused, so any related advice would be appreciated.