Transferred from: http://my.eoe.cn/864234/archive/5162.html
1:handler
12345678 |
This Handler class should is static or leaks might occur:incominghandler @SuppressLint("Handlerleak") c7>) Handlerhandlemessage(msg}; |
Workaround:
123456 |
Handler(Handler. Callbackhandlemessage(msgfalse}); |
Warning Reason:
2:simpledateformat
123456 |
To get local formatting with getdateinstance (), getdatetimeinstance (), or //Gettimeinstance (), or use new Simpl Edateformat (String template, Locale //locale) with for example locale.us for ASCII dates. @SuppressLint("SimpleDateFormat"SimpleDateFormat "yyyy-mm-ddhh:mm:ss"); |
Workaround:
12 |
SimpleDateFormat"yyyy mm month DD day hh"Locale. Getdefault()); |
Warning Reason:
**3:new HASHMAP () * *
12 |
@SuppressLint("Usesparsearrays") Map<IntegerStringHashMap< IntegerString> (); |
Workaround:
Warning Reason: Use new Sparsearray (...) instead for better performance
4: "String". toUpperCase (); "String". toLowerCase ();
12 |
@SuppressLint("Defaultlocale") boolean "String". toUpperCase(). equals("STRING"); |
Workaround:
1 |
Boolean "String". Equalsignorecase("STRING"); |
Warning Reason: Implicitly using the default locale is a common source of Bugs:use touppercase (locale) instead
Several yellow warning solutions for Android (GO)