Android native code calling on switch change