Codereview a bit of summary
1: Use Handler.post (Runnable) when using handler, Hanler to keep weak reference relationships with classes, or use static handler objects
Public Handler h = new Handler () {//is not recommended @Override public void Handlemessage (Message msg) { } };
<pre name= "code" class= "java" >public static Handler h = new Handler () {//recommended @Override public void Handlemes Sage (Message msg) { } };
H.post (..); /recommended
2:integer types and Enum types
When there are multiple cases of return values, the recommendation is to use Enum to judge. Instead of returning int type data! If you need to use the int type, you also need to encapsulate int into one socket for unified management
3: A small way to do only one thing, such as:
public void Update () {aa.update ();}
Do not appear:
public void Update () {aa.update ();
Bb.xxx ();}
Keep Code method names consistent with what you do
TODO Next Add
Android Codereview a bit summary