File tree Expand file tree Collapse file tree 2 files changed +1
-15
lines changed
app/src/main/java/to/bitkit Expand file tree Collapse file tree 2 files changed +1
-15
lines changed Original file line number Diff line number Diff line change @@ -55,18 +55,4 @@ class CurrentActivity : ActivityLifecycleCallbacks {
5555 override fun onActivitySaveInstanceState (activity : Activity , bundle : Bundle ) = Unit
5656 override fun onActivityDestroyed (activity : Activity ) = Unit
5757}
58-
59- /* *
60- * Returns the current activity of the application.
61- *
62- * **NEVER** store the result to a variable, further calls to such reference can lead to memory leaks.
63- *
64- * **ALWAYS** retrieve the current activity functionally, processing on the result of this function.
65- * */
66- internal inline fun <reified T > currentActivity (): T ? {
67- return when (val activity = App .currentActivity?.value) {
68- is T -> activity
69- else -> null
70- }
71- }
7258// endregion
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ class LightningNodeService : Service() {
101101 ACTION_STOP_SERVICE_AND_APP -> {
102102 Logger .debug(" ACTION_STOP_SERVICE_AND_APP detected" , context = TAG )
103103 // Close all activities
104- App .currentActivity?.value?.finishAffinity ()
104+ App .currentActivity?.value?.finishAndRemoveTask ()
105105 // Stop the service
106106 stopSelf()
107107 return START_NOT_STICKY
You can’t perform that action at this time.
0 commit comments