We want to use the preview SDK in our Android app. The BoxSession is created with the following code:
BoxAuthentication.BoxAuthenticationInfo info = new BoxAuthentication.BoxAuthenticationInfo();
info.setAccessToken(accessToken); // accessToken is the Box Access Token as String
session = new BoxSession(getApplicationContext(), info, this); // 'This' is the refreshListener
session.authenticate();
For previewing the document we do:
startActivityForResult(BoxPreviewActivity.getLaunchIntent(getApplicationContext(), session, file), 100); // file is the BoxFile
When clicking on a document the activity will launch, but crashes with the following error:
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.box.androidsdk.content.models.BoxUser.getId()' on a null object reference
We've checked the session and it seems that the session has all the right values. When we put breakpoints in the code and SDK, we see that in the middle of the SDK, the session loses its values.
Hello,
We want to use the preview SDK in our Android app. The BoxSession is created with the following code:
For previewing the document we do:
startActivityForResult(BoxPreviewActivity.getLaunchIntent(getApplicationContext(), session, file), 100); // file is the BoxFile
When clicking on a document the activity will launch, but crashes with the following error:
We've checked the session and it seems that the session has all the right values. When we put breakpoints in the code and SDK, we see that in the middle of the SDK, the session loses its values.
What to do?