daily pastebin goal
36%
SHARE
TWEET

Untitled

a guest Mar 14th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.   });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top