當前位置: 首頁>>代碼示例>>Java>>正文


Java ReactApplicationContext.addActivityEventListener方法代碼示例

本文整理匯總了Java中com.facebook.react.bridge.ReactApplicationContext.addActivityEventListener方法的典型用法代碼示例。如果您正苦於以下問題:Java ReactApplicationContext.addActivityEventListener方法的具體用法?Java ReactApplicationContext.addActivityEventListener怎麽用?Java ReactApplicationContext.addActivityEventListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.facebook.react.bridge.ReactApplicationContext的用法示例。


在下文中一共展示了ReactApplicationContext.addActivityEventListener方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: RNSettingsModule

import com.facebook.react.bridge.ReactApplicationContext; //導入方法依賴的package包/類
public RNSettingsModule(ReactApplicationContext reactContext) {
  super(reactContext);
  this.mReactContext = reactContext;

  this.registerReceiver(reactContext, Constants.PROVIDERS_CHANGED, new LocationReceiver());
  this.registerReceiver(reactContext, Constants.AIRPLANE_MODE_CHANGED, new AirplaneModeReceiver());

  mSettingsHandlers.put(Constants.LOCATION_SETTING, new LocationSettingsHandler(reactContext));
  mSettingsHandlers.put(Constants.AIRPLANE_MODE_SETTING, new AirplaneModeSettingsHandler(reactContext));

  mOpenSettingToRequestCode.put(Settings.ACTION_LOCATION_SOURCE_SETTINGS, 0);
  mOpenSettingToRequestCode.put(Settings.ACTION_AIRPLANE_MODE_SETTINGS, 1);

  mRequestCodeToOpenSetting.put(0, Settings.ACTION_LOCATION_SOURCE_SETTINGS);
  mRequestCodeToOpenSetting.put(1, Settings.ACTION_AIRPLANE_MODE_SETTINGS);

  mOpenSettingToSettingsName.put(Settings.ACTION_LOCATION_SOURCE_SETTINGS, Constants.LOCATION_SETTING);
  mOpenSettingToSettingsName.put(Settings.ACTION_AIRPLANE_MODE_SETTINGS, Constants.AIRPLANE_MODE_SETTING);

  reactContext.addActivityEventListener(mActivityEventListener);
}
 
開發者ID:rmrs,項目名稱:react-native-settings,代碼行數:22,代碼來源:RNSettingsModule.java

示例2: RNPushNotificationModule

import com.facebook.react.bridge.ReactApplicationContext; //導入方法依賴的package包/類
RNPushNotificationModule(ReactApplicationContext reactContext) {
        super(reactContext);

        reactContext.addActivityEventListener(this);

        Application applicationContext = (Application) reactContext.getApplicationContext();
        // The @ReactNative methods use this
        mRNPushNotificationHelper = new RNPushNotificationHelper(applicationContext);
        // This is used to delivery callbacks to JS
        mJsDelivery = new RNPushNotificationJsDelivery(reactContext);

        registerNotificationsRegistration();

//        //必須要設置默認的通知回調或者訂閱一個頻道,否則接收不到通知
//        PushService.setDefaultPushCallback(reactContext.getApplicationContext(), mRNPushNotificationHelper.getMainActivityClass());
//        //this.subscribeChannel("public");
    }
 
開發者ID:zzzkk2009,項目名稱:react-native-leancloud-sdk,代碼行數:18,代碼來源:RNPushNotificationModule.java

示例3: CafeBazaar

import com.facebook.react.bridge.ReactApplicationContext; //導入方法依賴的package包/類
public CafeBazaar(ReactApplicationContext reactContext, String licenseKey) {
    super(reactContext);
    _reactContext = reactContext;
    this.LICENSE_KEY = licenseKey;

    reactContext.addActivityEventListener(this);
}
 
開發者ID:contoriel,項目名稱:react-native-cafe-bazaar,代碼行數:8,代碼來源:CafeBazaar.java

示例4: RNMessageComposeModule

import com.facebook.react.bridge.ReactApplicationContext; //導入方法依賴的package包/類
public RNMessageComposeModule(final ReactApplicationContext reactContext) {
    super(reactContext);
    reactContext.addActivityEventListener(mActivityEventListener);
}
 
開發者ID:joonhocho,項目名稱:react-native-message-compose,代碼行數:5,代碼來源:RNMessageComposeModule.java

示例5: OnfidoSDK

import com.facebook.react.bridge.ReactApplicationContext; //導入方法依賴的package包/類
public OnfidoSDK(ReactApplicationContext reactContext) {
    super(reactContext);
    client = OnfidoFactory.create(reactContext).getClient();
    reactContext.addActivityEventListener(mActivityEventListener);
}
 
開發者ID:onfido,項目名稱:onfido-sdk-react-native-sample-app,代碼行數:6,代碼來源:OnfidoSDK.java

示例6: init

import com.facebook.react.bridge.ReactApplicationContext; //導入方法依賴的package包/類
private void init(@NonNull ReactApplicationContext context) {
    eventResultListener = new MercadoPagoCheckoutEventListener();
    context.addActivityEventListener(eventResultListener);
}
 
開發者ID:BlackBoxVision,項目名稱:react-native-mercadopago-checkout,代碼行數:5,代碼來源:MercadoPagoCheckoutModule.java

示例7: RNMailComposeModule

import com.facebook.react.bridge.ReactApplicationContext; //導入方法依賴的package包/類
public RNMailComposeModule(final ReactApplicationContext reactContext) {
    super(reactContext);
    reactContext.addActivityEventListener(mActivityEventListener);
}
 
開發者ID:joonhocho,項目名稱:react-native-mail-compose,代碼行數:5,代碼來源:RNMailComposeModule.java


注:本文中的com.facebook.react.bridge.ReactApplicationContext.addActivityEventListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。