Android - Unity3D: setVisibility(View.VISIBLE) crashes
Posted
by
Kazoeja
on Game Development
See other posts from Game Development
or by Kazoeja
Published on 2012-10-01T07:26:19Z
Indexed on
2012/10/01
9:50 UTC
Read the original article
Hit count: 168
I have a unity project and I use a Android (java) plugin to get camera data. I draw this on a TextureView. I want to hide/show this view when I press a button in unity. But my app crashes when I setVisibility
onCreate
UnityPlayer.currentActivity.addContentView(texView, new FrameLayout.LayoutParams(400, 400));
java:
public void HideVideo()
{
//Hide view
_TextureView.setVisibility(View.INVISIBLE);
}
Is there an extra function I need to call, or may I only call it on certain times?
None of these thins work, they all make my app crash.
_TextureView.setVisibility(View.INVISIBLE);
_TextureView.setActivated(false);
_TextureView.setAlpha(0);
_TextureView.setTranslationY(-1000);
© Game Development or respective owner