Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Create UnityPlayer instance with non activity context

$
0
0
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

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>