我想使用 Box SDK 进行身份验证。
我得到了Box Java SDK V2和Box Android SDK V2。我正在使用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);
}
}
但我收到此错误:
The method createOAuthActivityIntent(Context, String, String) from the type OAuthActivity refers to the missing type Intent
我做错了可能是愚蠢的事情,但是有人可以告诉我什么吗?