question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

_mActivity null in SupportFragment after the system kills processes when it needs to free up RAM

See original GitHub issue

Hi @YoKeyword

_mActivity null in SupportFragment after application is killed because another app needs memory I tested using the “Terminate Application” function in Android Studio

  • The first time: App is running --> tap the Home button --> Terminate Application --> restart App from backstack -->App works normally
  • Continue: --> tap the Home button --> Terminate Application --> restart App from backstack -->_Activity is null

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
YoKeywordcommented, Jun 29, 2017

It seems that you have repeatedly loaded Fragment when it comes back

In my demo:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
       ...
        if (findFragment(HomeFragment.class) == null) {
            loadRootFragment(R.id.fl_container, HomeFragment.newInstance());
        }
        ...
    }
0reactions
HuuNguyen312commented, Jun 29, 2017

This is the key to solving the issue. I just check savedInstanceState == null like Demo v0.10.7 Thank for your support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker process doesn't free up memory - macOS, Apple ...
I have just noticed the process Virtual Machine Service always taking 8.01GB RAM (~3.5 Real Memory). Restarting docker kills the process, but ...
Read more >
How to free up memory (RAM) on a Mac - Macworld
Here's how to free up memory including how to reduce Mac RAM usage without ... Did you see a “Your system has run...
Read more >
1907030 – "dnf update" runs out of memory on swapless ...
Description of problem: On a "Fedora 33 Cloud" instance on a: Bezosville "t4g.nano" machine (ARM Graviton, 0.5 GiB of RAM) ...
Read more >
[Fixed] Your System Has Run Out of Application Memory on Mac
Here are 8 methods on how to check and free up memory on Mac. Go through the following article to find the one...
Read more >
Having trouble freeing up memory in android app after ...
I tried running my app without debugger, but I can still only open and exit one scoreboard activity and two games before I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found