Closed lvonasek closed 4 weeks ago
No need to call teardown
with broadcast. Simply make protected void teardown() {}
in MainActivity, make
teardownprotected function with
@Override` and it will be available from MainActivity...
No need to call
teardown
with broadcast. Simply makeprotected void teardown() {}
in MainActivity, make
teardownprotected function with
@Override` and it will be available from MainActivity...
I tried that, it didn't work.
It did not work with exception or it simply and silently ignored changes?
I am not so sure about this but it seems to me you should pass it to GLSurfaceView's thread with GLSurfaceView.queueEvent
because it is not async.
And in clientConnectedStateChanged too.
It silently ignored the changes.
As far as I understand it. When I open the preference screen from the system notifications, it opens a new instance of the app which doesn't contain XrActivity.
That is correct, but why exactly you think it is related?
BradcastReceiver receiving notification about preferences changed is registered in runtime. So XrActivity receives it too.
It is like running two separate apps. The one with the preference screen doesn't contain instance of XrActivity.
I just tested this in XrActivity:
@Override
void onPreferencesChangedCallback() {
if (oldXrMode != prefs.xrMode.get()) {
Log.d("XXX", "XR=" + prefs.xrMode.get());
}
super.onPreferencesChangedCallback();
}
and it isn't called.
It is weird.
- Only one activity should be available at the same time.
It isn't possible to mix XR and 2D content in one activity. As I start the XrActivity another activity is created. In my point of view the behavior is expected.
- Broadcast about preferences change should be sent to both activities. It is being broadcasted. Something is broken.
I cannot say why the broadcast doesn't work. The XR behavior in Android apps isn't documented at all.
When user opens in the headset 2D preferences screen in XR mode then it behaves like two separate apps.
In this PR I did following changes:
getMainDisplay
XrActivity
tolibxrio
private