Will handler inside a method leak memory?
问题 I know handler declared in a class may leak memory since it holds a reference to its outer class. In this case, we should use static nested class with weak reference. But What if a handler is declared inside a method. I faced below case and not sure is it a correct implementation. Could someone please explain or give me a hint? I even don't know what I should search for. private void methodA(){ Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() {