react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[Android]call getCurrentActivity().findViewById method return null result

Open sLin90 opened this issue 10 years ago • 4 comments

javascript: findNodeHandle(this.refs.myView) //return 128 Call in the Java code getCurrentActivity().findViewById(128) return null Is what I call the wrong? RN 0.31.0

Help me to deal with this problem

sLin90 avatar Aug 26 '16 01:08 sLin90

test js call setTimeout delay 1000. call successful.

sLin90 avatar Aug 26 '16 02:08 sLin90

@289420843 reopen issue please, I have same bug, even onLayout it crashes

ivanzotov avatar Aug 01 '17 15:08 ivanzotov

Fixed – https://github.com/facebook/react-native/issues/2206#issuecomment-319621435

ivanzotov avatar Aug 02 '17 09:08 ivanzotov

This saved me. The timeout delay solved my problem. Why it's can't find native view after componentDIdMount ?

wd avatar Aug 08 '17 10:08 wd