Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29452

Cant get to assign a value to this variable in Android

$
0
0

I have init a variable:

public int state;

and I am assigning a value to it from this method:

@ReactMethod
public void getState(int s) {
    this.state = s;
}

but when I debug I can see that I am not getting the right value I am passing from React-Native code as a parameter 's'. It prints 0 instead of 5.

I am not good in android so I have been wondering what am I doing wrong here!


Viewing all articles
Browse latest Browse all 29452

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>