• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

requestPermissions Gives me a null error

ShatterStar

Newbie
Hi,

I have searched online but to no avail, I have a method in my Activity

Code:
public void requestSMSpermission()
{
    Object what = this;
    Object perm = Manifest.permission.SEND_SMS;

    ActivityCompat.requestPermissions(this , new String[]{Manifest.permission.SEND_SMS}, PERMISSIONS_REQUEST_SEND_SMS);
}
{/CODE]

But I get a null reference when I run this method, as you can see I am testing with variables to see if it is null but they aren't. What is going on?
 
Please show the full stack trace from the Logcat view.
 
Back
Top Bottom