Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MainActivity extends ReactActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- WritableMap map = Arguments.createMap();
- map.putString("key1", "Value1");
- map.putString("key1", "Value1");
- try {
- getReactInstanceManager().getCurrentReactContext()
- .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
- .emit("customEventName", map);
- } catch (Exception e){
- Log.e("ReactNative", "Caught Exception: " + e.getMessage());
- }
- }
- import { DeviceEventEmitter } from 'react-native';
- componentWillMount: function() {
- DeviceEventEmitter.addListener('keyboardWillShow', function(e: Event) {
- // handle event.
- });
Add Comment
Please, Sign In to add comment