0

I declare a private variable in the fragment HomeFragment.java,


    private List&ltWeatherCard&gt mWeatherCards = new ArrayList&lt&gt();


    public class WeatherCard {
    private String city;
    private TextView mWeatherIcon;
    private TextView mCityText;
    private TextView mTemperatureText;
    private TextView mRefreshTimeText;
    private TextView mDescription;
    private TextView mWindIcon;
    private CardView mCardView;
}

When I press the back button on the android navigation bar, application is closed and activity had called the onDestory() method, but I found the variable mWeatherCards is not being recycled, and that being cleaned only when I use taskmanager to close the app. What is the difference close app between the taskmanager and back button and When the android resources are freed?

Bamboo
  • 49
  • 4

1 Answers1

0

Application doesn't quit when you press back button, its moved to background and resources are still on hold. If you want to quit your application on back button, you can follow this link Android: Quit application when press back button

Community
  • 1
  • 1
Naveen
  • 830
  • 9
  • 19