File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
android/src/main/java/com/reactcommunity/rndatetimepicker Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,12 @@ class MaterialDatePickerModule(reactContext: ReactApplicationContext): NativeMod
18
18
}
19
19
20
20
override fun dismiss (promise : Promise ? ) {
21
- val activity = currentActivity as FragmentActivity ?
21
+ val activity = reactApplicationContext. currentActivity as FragmentActivity ?
22
22
dismissDialog(activity, NAME , promise)
23
23
}
24
24
25
25
override fun open (params : ReadableMap , promise : Promise ) {
26
- val activity = currentActivity as FragmentActivity ?
26
+ val activity = reactApplicationContext. currentActivity as FragmentActivity ?
27
27
if (activity == null ) {
28
28
promise.reject(
29
29
RNConstants .ERROR_NO_ACTIVITY ,
Original file line number Diff line number Diff line change @@ -19,12 +19,12 @@ class MaterialTimePickerModule(reactContext: ReactApplicationContext) :
19
19
}
20
20
21
21
override fun dismiss (promise : Promise ? ) {
22
- val activity = currentActivity as FragmentActivity ?
22
+ val activity = reactApplicationContext. currentActivity as FragmentActivity ?
23
23
dismissDialog(activity, NAME , promise)
24
24
}
25
25
26
26
override fun open (params : ReadableMap , promise : Promise ) {
27
- val activity = currentActivity as FragmentActivity ?
27
+ val activity = reactApplicationContext. currentActivity as FragmentActivity ?
28
28
if (activity == null ) {
29
29
promise.reject(
30
30
RNConstants .ERROR_NO_ACTIVITY ,
You can’t perform that action at this time.
0 commit comments