LeakScope: Android Lifecycle & Memory Leak Violations
About this report: This issue was automatically generated by LeakScope, a static analysis tool for Android lifecycle violations and memory leaks built on the Soot framework. This is part of an ongoing academic research study targeting ICSE 2027. No immediate action is required — we would greatly appreciate your feedback on whether these findings are accurate.
Summary
LeakScope detected 20 potential issue(s) across 2 detector type(s):
| Severity |
Count |
| 🔴 High |
19 |
| 🟡 Medium |
0 |
| 🟢 Low (improvement opportunity) |
1 |
| Detector |
Count |
Severity |
Description |
FragmentViewFieldRetentionLeak |
19 |
🔴 High |
Fragment stores View references in instance fields not cleared in onDestroyView() |
ViewBindingOpportunity |
1 |
🟢 Low |
Manual findViewById() calls — ViewBinding migration opportunity |
Detailed Findings
🔴 FragmentViewFieldRetentionLeak
Fragment stores View references in instance fields not cleared in onDestroyView()
Finding #1 — HomeFragment
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.HomeFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• status : android.widget.ImageView (assigned in onViewCreated)
• statusText : android.widget.TextView (assigned in onViewCreated)
• button : android.widget.Button (assigned in onViewCreated)
• debugStatus : android.widget.TextView (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
status = null;
statusText = null;
button = null;
d
… (truncated for brevity)
Finding #2 — AboutFragment
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.AboutFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• aboutGithub : android.widget.TextView (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
aboutGithub = null;
}
Finding #3 — ConnectFragment
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.ConnectFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• status : android.widget.ImageView (assigned in onViewCreated)
• statusText : android.widget.TextView (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
status = null;
statusText = null;
}
Finding #4 — MouseFragment
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.MouseFragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() does not clear all View fields
Leaked Fields:
• root : android.widget.RelativeLayout (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
root = null;
}
Finding #5 — ConnectConnectedSubfragment
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.connect.ConnectConnectedSubfragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• elapsed : android.widget.Chronometer (assigned in onViewCreated)
• name : android.widget.TextView (assigned in onViewCreated)
• disconnect : android.widget.Button (assigned in onViewCreated)
• mouse : android.widget.Button (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
elapsed = null;
name = null;
disconnec
… (truncated for brevity)
Finding #6 — ConnectFailedSubfragment
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.connect.ConnectFailedSubfragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• device : android.widget.TextView (assigned in onViewCreated)
• back : android.widget.Button (assigned in onViewCreated)
• remove : android.widget.Button (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
device = null;
back = null;
remove = null;
}
Finding #7 — ConnectSelectSubfragment
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.connect.ConnectSelectSubfragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• list : androidx.recyclerview.widget.RecyclerView (assigned in onViewCreated)
• add : android.widget.Button (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
list = null;
add = null;
}
Finding #8 — HomeUnsupportedSubfragment
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.home.HomeUnsupportedSubfragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• playstoreLink : android.widget.Button (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
playstoreLink = null;
}
Finding #9 — HomeDisabledSubfragment
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.home.HomeDisabledSubfragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• refresh : android.widget.Button (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
refresh = null;
}
Finding #10 — HomeConnectedSubfragment
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.home.HomeConnectedSubfragment
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• chronometer : android.widget.Chronometer (assigned in onViewCreated)
• device : android.widget.TextView (assigned in onViewCreated)
• more : android.widget.Button (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
chronometer = null;
device = null;
more = null;
}
Finding #11 — CalibrationHappeningSubdialog
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.settings.dialog.CalibrationHappeningSubdialog
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• time : android.widget.TextView (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
time = null;
}
Finding #12 — MouseUsageFinishedSubdialog
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.mouse.MouseUsageFinishedSubdialog
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• notAgain : android.widget.CheckBox (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
notAgain = null;
}
Finding #13 — MouseMessageSubdialog
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.mouse.MouseMessageSubdialog
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• messageView : android.widget.TextView (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
messageView = null;
}
Finding #14 — AddSuccessSubdialog
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.connect.dialog.AddSuccessSubdialog
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• name : android.widget.TextView (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
name = null;
}
Finding #15 — AddRequestSettingSubdialog
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.connect.dialog.AddRequestSettingSubdialog
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• error : android.widget.TextView (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
error = null;
}
Finding #16 — AddManualSubdialog
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.connect.dialog.AddManualSubdialog
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• nameLayout : com.google.android.material.textfield.TextInputLayout (assigned in onViewCreated)
• macLayout : com.google.android.material.textfield.TextInputLayout (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
nameLayout = null;
macLayout = null;
}
Finding #17 — AddSelectSubdialog
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.connect.dialog.AddSelectSubdialog
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• list : androidx.recyclerview.widget.RecyclerView (assigned in onViewCreated)
• scanning : android.widget.Button (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
list = null;
scanning = null;
}
Finding #18 — AddBondedSubdialog
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.connect.dialog.AddBondedSubdialog
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• error : android.widget.TextView (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
error = null;
}
Finding #19 — AddRequestPermissionSubdialog
Fragment View Field Retention Leak Detected
Class: ch.virt.smartphonemouse.ui.connect.dialog.AddRequestPermissionSubdialog
Issue:
- Fragment stores View references in instance fields
- These fields are not cleared when the view is destroyed
- onDestroyView() is missing
Leaked Fields:
• error : android.widget.TextView (assigned in onViewCreated)
Why this is dangerous:
- Fragment views are destroyed/recreated on config changes
- Retained View references prevent garbage collection
- Leaked Views hold references to Activity Context
- Can cause OutOfMemoryError with repeated Fragment transactions
Recommended Fix:
Override onDestroyView() and clear all View/Binding fields:
@Override
public void onDestroyView() {
super.onDestroyView();
error = null;
}
🟢 ViewBindingOpportunity
Manual findViewById() calls — ViewBinding migration opportunity
Finding #20 — MainActivity
View Binding Migration Opportunity
Class: ch.virt.smartphonemouse.MainActivity
Type: Activity
Current Pattern: Manual view lookup
findViewById() Calls:
• findViewById in loadComponents
• findViewById in loadComponents
• findViewById in loadComponents
Benefits of View Binding:
- Eliminates boilerplate findViewById() calls
- Compile-time type safety for view references
- Reduced null pointer exceptions
- Cleaner, more maintainable code
Note: This is a code modernization suggestion, not a memory leak
How to respond to this issue:
- If a finding is a true positive: consider applying the recommended fix and closing this issue.
- If a finding is a false positive: please leave a comment explaining why — your feedback directly improves our research.
- If you have questions: reply here or open a discussion.
This report was generated by LeakScope as part of the ICSE 2027 research artifact. Tool analyzes compiled APKs using Soot static analysis on SmartMouse.
LeakScope: Android Lifecycle & Memory Leak Violations
Summary
LeakScope detected 20 potential issue(s) across 2 detector type(s):
FragmentViewFieldRetentionLeakViewBindingOpportunityDetailed Findings
🔴
FragmentViewFieldRetentionLeakFragment stores View references in instance fields not cleared in onDestroyView()
Finding #1 —
HomeFragmentFinding #2 —
AboutFragmentFinding #3 —
ConnectFragmentFinding #4 —
MouseFragmentFinding #5 —
ConnectConnectedSubfragmentFinding #6 —
ConnectFailedSubfragmentFinding #7 —
ConnectSelectSubfragmentFinding #8 —
HomeUnsupportedSubfragmentFinding #9 —
HomeDisabledSubfragmentFinding #10 —
HomeConnectedSubfragmentFinding #11 —
CalibrationHappeningSubdialogFinding #12 —
MouseUsageFinishedSubdialogFinding #13 —
MouseMessageSubdialogFinding #14 —
AddSuccessSubdialogFinding #15 —
AddRequestSettingSubdialogFinding #16 —
AddManualSubdialogFinding #17 —
AddSelectSubdialogFinding #18 —
AddBondedSubdialogFinding #19 —
AddRequestPermissionSubdialog🟢
ViewBindingOpportunityManual findViewById() calls — ViewBinding migration opportunity
Finding #20 —
MainActivityHow to respond to this issue:
This report was generated by LeakScope as part of the ICSE 2027 research artifact. Tool analyzes compiled APKs using Soot static analysis on SmartMouse.