当前位置: 首页>>代码示例>>Java>>正文


Java ReactApplicationContext.addLifecycleEventListener方法代码示例

本文整理汇总了Java中com.facebook.react.bridge.ReactApplicationContext.addLifecycleEventListener方法的典型用法代码示例。如果您正苦于以下问题:Java ReactApplicationContext.addLifecycleEventListener方法的具体用法?Java ReactApplicationContext.addLifecycleEventListener怎么用?Java ReactApplicationContext.addLifecycleEventListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.react.bridge.ReactApplicationContext的用法示例。


在下文中一共展示了ReactApplicationContext.addLifecycleEventListener方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
@Override
public void initialize() {
    Log.d(TAG, "Initializing");
    super.initialize();

    // Read in an existing scheduled job if there is one
    Set<JobRequest> jobRequests = JobManager.instance().getAllJobRequests();
    if (jobRequests.size() > 1) {
        Log.w(TAG, "Found " + jobRequests.size() + " scheduled jobs, expecting 0 or 1");
    }
    if (!jobRequests.isEmpty()) {
        mJobRequest = jobRequests.iterator().next();
    }

    // Hook into lifecycle events so we can tell when the application is foregrounded
    ReactApplicationContext context = getReactApplicationContext();
    context.addLifecycleEventListener(this);
}
 
开发者ID:jamesisaac,项目名称:react-native-background-task,代码行数:19,代码来源:BackgroundTaskModule.java

示例2: WearCommunicationModule

import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
public WearCommunicationModule(ReactApplicationContext reactContext) {
  super(reactContext);
  reactContext.addLifecycleEventListener(this);
  googleApiClient = new GoogleApiClient.Builder(getReactApplicationContext()).addApi(Wearable.API)
    .addConnectionCallbacks(this)
    .build();
}
 
开发者ID:bevkoski,项目名称:react-native-android-wear-demo,代码行数:8,代码来源:WearCommunicationModule.java

示例3: RNThreadModule

import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
public RNThreadModule(final ReactApplicationContext reactContext, ReactNativeHost reactNativehost, ReactPackage additionalThreadPackages[]) {
  super(reactContext);
  this.reactApplicationContext = reactContext;
  threads = new HashMap<>();
  this.reactNativeHost = reactNativehost;
  this.additionalThreadPackages = additionalThreadPackages;
  reactContext.addLifecycleEventListener(this);
}
 
开发者ID:joltup,项目名称:react-native-threads,代码行数:9,代码来源:RNThreadModule.java

示例4: RNRxBluetoothModule

import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
public RNRxBluetoothModule(ReactApplicationContext reactContext) {
    super(reactContext);
    this.reactContext = reactContext;
    reactContext.addLifecycleEventListener(this);
    rxBluetooth = new RxBluetooth(reactContext);
    installSubscriptions();
}
 
开发者ID:eove,项目名称:RNRxBluetooth,代码行数:8,代码来源:RNRxBluetoothModule.java

示例5: UIManagerModule

import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
public UIManagerModule(
    ReactApplicationContext reactContext,
    List<ViewManager> viewManagerList,
    UIImplementationProvider uiImplementationProvider,
    boolean lazyViewManagersEnabled) {
  super(reactContext);
  DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(reactContext);
  mEventDispatcher = new EventDispatcher(reactContext);
  mModuleConstants = createConstants(viewManagerList, lazyViewManagersEnabled);
  mUIImplementation = uiImplementationProvider
    .createUIImplementation(reactContext, viewManagerList, mEventDispatcher);

  reactContext.addLifecycleEventListener(this);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:15,代码来源:UIManagerModule.java

示例6: NearbyModule

import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
public NearbyModule(ReactApplicationContext reactContext) {
    super(reactContext);
    reactContext.addLifecycleEventListener(this);
}
 
开发者ID:miguelespinoza,项目名称:react-native-nearby,代码行数:5,代码来源:NearbyModule.java

示例7: GrowingIOModule

import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
public GrowingIOModule(ReactApplicationContext reactContext) {
    super(reactContext);
    reactContext.addLifecycleEventListener(this);
}
 
开发者ID:growingio,项目名称:react-native-growingio,代码行数:5,代码来源:GrowingIOModule.java

示例8: RNDatecsPrinterModule

import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
public RNDatecsPrinterModule(ReactApplicationContext reactContext) {
	super(reactContext);

	reactContext.addLifecycleEventListener(this);
	mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
}
 
开发者ID:recs182,项目名称:react-native-datecs-printer,代码行数:7,代码来源:RNDatecsPrinterModule.java


注:本文中的com.facebook.react.bridge.ReactApplicationContext.addLifecycleEventListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。