本文整理汇总了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);
}
示例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();
}
示例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);
}
示例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();
}
示例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);
}
示例6: NearbyModule
import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
public NearbyModule(ReactApplicationContext reactContext) {
super(reactContext);
reactContext.addLifecycleEventListener(this);
}
示例7: GrowingIOModule
import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
public GrowingIOModule(ReactApplicationContext reactContext) {
super(reactContext);
reactContext.addLifecycleEventListener(this);
}
示例8: RNDatecsPrinterModule
import com.facebook.react.bridge.ReactApplicationContext; //导入方法依赖的package包/类
public RNDatecsPrinterModule(ReactApplicationContext reactContext) {
super(reactContext);
reactContext.addLifecycleEventListener(this);
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
}