Symptom
Opentok Android SDK version 2.28.2 can generate the error below if you use an application context to initialize a publisher.
java.lang.UnsupportedOperationException: Tried to obtain display from a Context
not associated with one. Only visual Contexts (such as Activity or one created
with Context#createWindowContext) or ones created with Context#createDisplayContext
are associated with displays. Other types of Contexts are typically related to
background entities and may
return
an arbitrary display
In previous SDK versions, it was possible to build a new publisher using the application context.
Applies To
- Video API
- Android SDK
Resolution
In 2.28.2 it is necessary to pass the activity context and not the application context to the publisher builder.
Cause
This issue occurs because a function in the Android SDK was deprecated. Changes were made to remove dependency on the deprecated functions. We are currently testing alternative options that would again allow usage of the application context and hope to get these included in the next release.
Additional Information
For more details, please visit to android SDK release notes: https://tokbox.com/developer/sdks/android/release-notes.html
Related to:
Articles in this section
- Android SDK 2.28.2 error when using the application context
- What happens if your session lasts more than 8 hours?
- Updates to using the Vonage Media Library in Native SDKs from version 2.27.x onwards
- React-Native Zoom In/Out Feature
- Why has the size of the iOS/Android SDKs increased so much from version 2.25.2?
- Integrating Picture-in-Picture with Vonage Video Web
- How to Use the Vonage Media Processor Library for Audio and Video Transformations
- Screen Sharing Support on Mobile Devices
- How to change the strength of the Background Blur?
- What are the minimum system requirements to use Video Filters or Transformers?