1) I would not use static classes at all. Especially if you need to pass a context pointer, as this will cause a leak. If you do not have static classes on constants, they are similar to global variables and can bypass the Android architecture, which is designed for decoupling actions.
In particular, you do not want to declare instances of Drawable or Android framework as static. It scares their life.
2) I did not see problems with anonymous classes in particular. In some cases, you can skip the Context variable, but this is difficult to do in a single thread. When traversing a context, you can limit leaks using getApplicationContext (), which returns a global context that will not leak.
Hope this helps!
swinefeaster
source share