I've been wondering about something in android development.

I have a class for requesting permissions to the device in an easier way for me, this class name is `PermissionRequester`

```
public class PermissionRequester{
    int sdk;
    Context context;

    public PermissionRequester(Context context) {
                this.context = context;
                sdk = Build.VERSION.SDK_INT;
            }
} 

```

In a beginning, I was requesting a Context in my constructor for checking if the permission was allowed or denied by the user. Using Context didn't work, so I change "Context" to "Activity" and it worked.

```
public class PermissionRequester {
    int sdk;
    Activity activity;

    public PermissionRequester(Activity activity) {
                this.activity = activity;
                sdk = Build.VERSION.SDK_INT;
            }
}

```

In my MainActivity, I instanciate like this

```
PermissionRequester requester = new PermissionRequester(MainActivity.this);

```

So my question is the next:

> 
> * Why didn't I get a compile error in both cases using Context and Activity?
> 
> 
>