GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: memory leak caused by not destroying worker frag · devqmr/RxJava-Android-Samples@0c9aa40

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • app/src/main/java/com/morihacky/android/rxjava
    • MainActivity.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎app/src/main/java/com/morihacky/android/rxjava/MainActivity.java‎

Copy file name to clipboardExpand all lines: app/src/main/java/com/morihacky/android/rxjava/MainActivity.java
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.morihacky.android.rxjava;
22

33
import android.os.Bundle;
4+
import android.support.v4.app.Fragment;
45
import android.support.v4.app.FragmentActivity;
56
import com.morihacky.android.rxjava.rxbus.RxBus;
67

@@ -18,6 +19,18 @@ public RxBus getRxBusSingleton() {
1819
return _rxBus;
1920
}
2021

22+
@Override
23+
public void onBackPressed() {
24+
super.onBackPressed();
25+
26+
Fragment frag = getSupportFragmentManager()//
27+
.findFragmentByTag(RotationPersistWorkerFragment.class.getName());
28+
29+
if (frag != null) {
30+
getSupportFragmentManager().beginTransaction().remove(frag).commit();
31+
}
32+
}
33+
2134
@Override
2235
protected void onCreate(Bundle savedInstanceState) {
2336
super.onCreate(savedInstanceState);

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.