- Home /
Button On Click Add Listener working in editor but not in android
the button is assigned from editor. everything works fine in editor but not in android. if i set it manually it works fine.
public Button TestBtn;
void Start()
{
TestBtn.onClick.AddListener(() => test());
}
Comment
Why are you not using onClick events of the Button component?
You can just drag the gameobject (where the script contains) on onClick event, and then choose test() function.
You sure Start gets called on Android? You sure the button gets clicked?
why the start function called in editor but not on android?