When I try to create instance of UnityPlayer in native android, passing context that is not activity:
mUnityPlayer = new UnityPlayer(getContext());
e.g. application context, my app crash with following stack trace:
2021-05-27 15:40:09.776 2276-2328/com.DefaultCompany.LW2WithOlderUnityVersion A/zygote64: java_vm_ext.cc:534] JNI DETECTED ERROR IN APPLICATION: can't call android.view.WindowManager android.app.Activity.getWindowManager() on null object
2021-05-27...
Create UnityPlayer instance with non activity context
mUnityPlayer = new UnityPlayer(getContext());
e.g. application context, my app crash with following stack trace:
2021-05-27 15:40:09.776 2276-2328/com.DefaultCompany.LW2WithOlderUnityVersion A/zygote64: java_vm_ext.cc:534] JNI DETECTED ERROR IN APPLICATION: can't call android.view.WindowManager android.app.Activity.getWindowManager() on null object
2021-05-27...
Create UnityPlayer instance with non activity context