1

I want to authenticate using the Box SDK.

I got the Box Java SDK V2 and the Box Android SDK V2. And I'm using the basic authentication code from the Box Android SDK

Intent intent = OAuthActivity.createOAuthActivityIntent(this, clientId, 
    clientSecret);
startActivityForResult(intent);

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode == Activity.RESULT_CANCELED) {
        // Get the error message for why authentication failed.
        String failMessage = data.getStringExtra(OAuthActivity.ERROR_MESSAGE);
        // Implement your own logic to handle the error.
       handleFail(failMessage);
    } else {
        // You will get an authenticated BoxClient object back upon success.
        BoxClient client =
            data.getParcelableExtra(OAuthActivity.BOX_CLIENT);
        youOwnMethod(client);
    }
}

but I'm getting this error:

The method createOAuthActivityIntent(Context, String, String) from the type OAuthActivity refers to the missing type Intent

It's probably something stupid I'm doing wrong, but can someone tell me what?

4

1 に答える 1