The question has matured by chance when I switched from Eclipse to AS. The compiler writes a warning (indicated in the topic). But it confuses me. The point is this. There is a class, I get a copy of it. I use his methods. After using the variable that received this instance, I reset (= null).
MyPreferences pref = new MyPreferences(); pref.loaddata(); ...использую методы класса MyPreferences pref = null; Here on the last line AS warns. But I used to read such a phrase that "Android does not like resource leaks, so we release the variable .... and assign null to it". Help me figure out how to write correctly ... thanks.