I am trying to integrate my NDK application with Google Drive. I am following the Sample Application and adapting it to being used from my native code. I have gotten it to launch the account picker successfully, but am now stuck at how to get the result from the account picker. I launch the account picker using JNI calls from my code
In the code sample, the onActivityResult
method is called on the activity when other intents return.
@Override
protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
switch (requestCode) {
case REQUEST_ACCOUNT_PICKER:
if (resultCode == RESULT_OK && data != null && data.getExtras() != null) {
String accountName = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);
if (accountName != null) {
credential.setSelectedAccountName(accountName);
service = getDriveService(credential);
startCameraIntent();
}
}
break;
}
}
Is there a way to do a similar thing using the NDK? I want to create a function in C and set it as the callback for onActivityResult
.