[VisionGlass] Create the GestureManager from an UI context #1711
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In order to initialize properly the GestureManager object it must be created with an UI context, like for example an Activity. Use the Wolvic's main activity to initialize it.
This was found by StrictMode. It was throwing the following exception:
Tried to access the API:GestureDetector#init which needs to have proper configuration from a non-UI Context:com.igalia.wolvic.VRBrowserApplication@ff7c8aa The API:GestureDetector#init needs a proper configuration. Use UI contexts such as an activity or a context created via createWindowContext(Display, int, Bundle) or createConfigurationContext(Configuration) with a proper configuration.
java.lang.IllegalAccessException: Tried to access the API:GestureDetector#init which needs to have proper configuration from a non-UI Context:com.igalia.wolvic.VRBrowserApplication@ff7c8aa
at android.os.StrictMode.assertConfigurationContext(StrictMode.java:2297)
at android.view.GestureDetector.init(GestureDetector.java:480)
at android.view.GestureDetector.(GestureDetector.java:440)
at android.view.GestureDetector.(GestureDetector.java:408)
at com.igalia.wolvic.PlatformActivity$PlatformActivityPluginVisionGlass.setupPhoneUI(PlatformActivity.java:654)
at com.igalia.wolvic.PlatformActivity$PlatformActivityPluginVisionGlass.(PlatformActivity.java:541)
at com.igalia.wolvic.PlatformActivity.createPlatformPlugin(PlatformActivity.java:531)
at com.igalia.wolvic.VRBrowserActivity.initializeWidgets(VRBrowserActivity.java:477)
at com.igalia.wolvic.VRBrowserActivity.onCreate(VRBrowserActivity.java:362)