I am seeing code like this following:
Intent intent = new Intent(MainActivity.this, SecondActivity.class);
For example, in this question, this question and many other more.
But is it necessary to have the class name MainActivity
in front of the this
pointer? I remove it and don't see any differences in the app at all. As a matter of fact, when I am reading the documentation, the Acitivity name is not being used in front of the this
.