Is there any difference between finish() and ActivityName.this.finish()? If we have activity with name SampleActivity, we can finish it by calling finish() and by SampleActivity.this.finish(). What is the difference?
Is there any difference between finish() and ActivityName.this.finish() ? If we have activity with
Share
Most of the time it’s the same except if you are inside an inner class.
In that case the second notation is used to disambiguate calls to the containing activity’s methods.
For instance: