In my Android project, I define a few callbacks to operate on button clicks, connectivity events, or UI events such as Dilaog.onShow(). For demo purposes, I have chosen a Runnable interface that must be launched from some Activity code. With Java, I have different ways to express myself.

I guess that the choice is mostly an issue of taste or religious belief, but I would like to receive hints and advises that could help me develop my own preference, possibly - different preferences according to the given circumstance.

Like @Manuel Silva and @Toby Champion, I dislike anonymous inner classes. They are somewhat hard to read, aren't very "OO" in that they can't be extended, can't have DIP, setters or whatever to tweak behavior, etc..., and they often end up violating the DRY principle when you add the same code in 27 different places.

I tend to use private members (your option #3), or a private function (your 4th style) typically named getAsRunnable().

From my point of view, anonymous class really decrease readability. Because Ui code is often very verbose, adding anonymous callbacks for every button can lead to very very big classes. As a consequence I am using internal private classes.