@@ -160,23 +160,18 @@ public void dispose() {
160160 // but seems redundant to call it here, since dispose() is triggered by
161161 // the onDestroy() handler, which means that the app is already
162162 // being destroyed.
163-
164- activity = null ;
165163 }
166164
167165 if (view != null ) {
168166 view .destroyDrawingCache ();
169- view = null ;
170167 }
171168
172169 if (component != null ) {
173170 component .dispose ();
174- component = null ;
175171 }
176172
177173 if (surfaceView != null ) {
178174 surfaceView .getHolder ().getSurface ().release ();
179- surfaceView = null ;
180175 }
181176 }
182177
@@ -348,15 +343,17 @@ public void setSystemUiVisibility(int visibility) {
348343
349344 @ Override
350345 public void finish () {
351- if (component == null ) return ;
352-
353- if (component .getKind () == AppComponent .FRAGMENT ) {
354- activity .finish ();
355- } else if (component .getKind () == AppComponent .WALLPAPER ) {
356- wallpaper .stopSelf ();
357- } else if (component .getKind () == AppComponent .WATCHFACE ) {
358- watchface .stopSelf ();
359- }
346+ // No need to do anything here, as the Android system will take care of
347+ // releasing activity resources if needed, etc.
348+ // if (component == null) return;
349+ //
350+ // if (component.getKind() == AppComponent.FRAGMENT) {
351+ // activity.finish();
352+ // } else if (component.getKind() == AppComponent.WALLPAPER) {
353+ // wallpaper.stopSelf();
354+ // } else if (component.getKind() == AppComponent.WATCHFACE) {
355+ // watchface.stopSelf();
356+ // }
360357 }
361358
362359
@@ -414,7 +411,7 @@ public boolean stopThread() {
414411
415412 @ Override
416413 public boolean isStopped () {
417- return thread == null ;
414+ return thread == null ;
418415 }
419416
420417
0 commit comments