Guest User

Untitled

a guest
Mar 14th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. public class MainActivity extends ReactActivity {
  2.  
  3. @Override
  4. protected void onCreate(Bundle savedInstanceState) {
  5. super.onCreate(savedInstanceState);
  6.  
  7. WritableMap map = Arguments.createMap();
  8. map.putString("key1", "Value1");
  9. map.putString("key1", "Value1");
  10.  
  11. try {
  12. getReactInstanceManager().getCurrentReactContext()
  13. .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
  14. .emit("customEventName", map);
  15. } catch (Exception e){
  16. Log.e("ReactNative", "Caught Exception: " + e.getMessage());
  17. }
  18. }
  19.  
  20. import { DeviceEventEmitter } from 'react-native';
  21.  
  22. componentWillMount: function() {
  23. DeviceEventEmitter.addListener('keyboardWillShow', function(e: Event) {
  24. // handle event.
  25. });
Add Comment
Please, Sign In to add comment