-1

In an example like the one bellow :

 public boolean checkLocationPermission() {
        if(ContextCompat.checkSelfPermission(this,
                Manifest.permission.ACCESS_FINE_LOCATION)
                != PackageManager.PERMISSION_GRANTED){

What does this exactly point to. I understand that it is pointing to the current context in which the method is being implemented. But i'm not sure what is the scope of that context. Is it always reffering to the class the method is in?

Faris Kapo
  • 346
  • 9
  • 30
  • 1
    it means current context, in this example, current class instance (self) – Antoniossss Nov 17 '17 at 22:22
  • 5
    This is a strong indication you need a book on Java. There's nothing wrong with learning, but stumbling around aimlessly and depending on tutorials is not an effective way to learn. Get a good introduction book and reference to help steer you in the right direction. – tadman Nov 17 '17 at 22:25

1 Answers1

0

this is a reference for current instance of the object. in this piece of code it means that this references to current instance of the activity and as a result reference to the context of that activity

LifeStyle
  • 411
  • 2
  • 10