- Home /
Question by
$$anonymous$$ · Oct 01, 2012 at 10:08 AM ·
androidjava
Android - Unity3D: setVisibility(View.VISIBLE) crashes
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 in java:
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 things work, they all make my app crash.
_TextureView.setVisibility(View.INVISIBLE);
_TextureView.setActivated(false);
_TextureView.setAlpha(0);
_TextureView.setTranslationY(-1000);
Comment