Bhargav
Bhargav

Reputation: 8277

What happens to instance variables in a activity class after minimizing and maximizing the application

What happens to instance variables in a activity class after minimizing and maximizing the application when on that particular activity. I couldn't find a straight forward answer to this question. Also will variables that hold references to expensive resources like a DB connection be treated differently?

Upvotes: 0

Views: 110

Answers (1)

Henry
Henry

Reputation: 43728

Don't rely on any behaviour you observe, instead be sure to implement the Activity Life Cycle correctly. Whenever the onDestroy method is called, all instance variables will be gone.

Upvotes: 1

Related Questions