Request Permission from Application class
<p>As per the new Android doc, In order to collect certain data, I need to request for permission. So I am doing this :</p>

<pre><code>@Override
public void onCreate() {
    super.onCreate();
    ...
    ...
    if (PermissionUtility.isPermitted(applicationContext, android.Manifest.permission.READ_SMS)) {
        userNumber = getUserPhoneNumber();
    } else {
        ActivityCompat.requestPermissions(activity,
                new String[]{android.Manifest.permission.READ_SMS},
                Constants.REQUEST_CODE_READ_SMS);
    }
    ...
    ...
}
</code></pre>

<p>The problem is I m doing it in my class which is <code>public class MyApplication extends Application{...}</code> so <code>activity</code> isn't available here. Is there a way to ask for permissions in this class  or a way around to pass an activity?</p>