1:Handler
// This Handler class should be static or leaks might occur: IncomingHandler
    @SuppressLint("HandlerLeak")
    private Handler mHandler = new Handler() {
        @Override
        public void handleMessage(Message msg) {

};
    };
    
解决方法:

private Handler mHandler = new Handler(new Handler.Callback() {
        @Override
        public boolean handleMessage(Message msg) {
            return false;
        }
    });

2:SimpleDateFormat

// To get local formatting use getDateInstance(), getDateTimeInstance(), or
    // getTimeInstance(), or use new SimpleDateFormat(String template, Locale
    // locale) with for example Locale.US for ASCII dates.
    @SuppressLint("SimpleDateFormat")
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat(
            "yyyy-MM-ddHH:mm:ss");
解决方法:

SimpleDateFormat newSimpleDateFormat = new SimpleDateFormat(
            "yyyy年MM月dd日HH时mm分", Locale.getDefault());

3:new HashMap() 
    @SuppressLint("UseSparseArrays")
    public static Map CMD_MAP = new HashMap();

警告原因:Use new SparseArray(...) instead for better performance

4:"String".toUpperCase(); "String".toLowerCase();

@SuppressLint("DefaultLocale")
    boolean  b = "String".toUpperCase().equals("STRING");
解决方法:
 boolean  b = "String".equalsIgnoreCase("STRING");
警告原因:Implicitly using the default locale is a common source of bugs: Use toUpperCase(Locale) instead

最新文章

  1. C#错过的10年
  2. 《数据结构》2.2顺序表(sequence list)
  3. Effective C++ -----条款44:将与参数无关的代码抽离templates
  4. android程序---->android多线程下载(一)
  5. 通俗易懂------this指向
  6. ORCALE用户授权与创建同义词
  7. NFS参数配置详细说明
  8. Qt解析XML文件(QXmlStreamReader)
  9. HDU 5044 离线LCA算法
  10. 关于Cocos2dx之JS创建项目
  11. .Neter玩转Linux系列之二:Linux下的文件目录及文件目录的权限
  12. java跟oracle如何计算时间差
  13. HTML百宝箱(1从0开始)
  14. JS关键字和保留字汇总(小记)
  15. 微信小程序,加载更多
  16. Property referenced in indexed property path is neither an array nor a List nor a Map
  17. Howto Building GNU Toolchains
  18. PHPSQL注入
  19. networkManger介绍
  20. 怎样解决IIS6.0上传文件限制的问题?

热门文章

  1. 四. Java继承和多态1. 继承的概念与实现
  2. 图床plus演示 | 图床及在线分享演示文稿工具
  3. MySQL四种类型日志:Error Log、General Query Log、Binary Log、Slow Query Log
  4. [Bug] 未找到导入的项目“C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets”
  5. Stub, Mock and Proxy Testing
  6. 1019(C++)
  7. 遗传算法解决TSP问题
  8. Hadoop之Mapreduce详解
  9. .Net程序测试阿里云OSS开放存储服务
  10. SQL Server 2008 导入MDF数据库文件