转自:http://my.eoe.cn/864234/archive/5162.html

1:Handler

1
2
3
4
5
6
7
8
    // This Handler class should be static or leaks might occur: IncomingHandler
@SuppressLint("HandlerLeak")
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) { };
};

解决方法:

1
2
3
4
5
6
    private Handler mHandler = new Handler(new Handler.Callback() {
@Override
public boolean handleMessage(Message msg) {
return false;
}
});

警告原因:

2:SimpleDateFormat

1
2
3
4
5
6
    // 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");

解决方法:

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

警告原因:

**3:new HashMap() **

1
2
     @SuppressLint("UseSparseArrays")
public static Map<Integer, String> CMD_MAP = new HashMap<Integer, String>();

解决方法:

1
 //TODO

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

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

1
2
     @SuppressLint("DefaultLocale")
boolean b = "String".toUpperCase().equals("STRING");

解决方法:

1
 boolean  b = "String".equalsIgnoreCase("STRING");

警告原因:Implicitly using the default locale is a common source of bugs: Use toUpperCase(Locale) instead

android 的几个黄色警告解决办法(转)的更多相关文章

  1. 配置Android环境遇到的问题及解决办法

    配置Android环境遇到的问题及解决办法: 1 环境安装地址 http://pan.baidu.com/s/1jGzNzyI 2 其他: 2.1 安装 2.1.1 安装JDK,JRE 成功安装之后, ...

  2. Apple Mach-O Linker Warning 警告解决办法

    此警告解决办法: 项目名字 -> targets -> Build Settings -> search path

  3. import android.support.v4或者import android.support.v7提示导入错误解决办法

    转自:  http://blog.csdn.net/forandever/article/details/37655139 在使用Eclipse开发andriod程序时,程序中提示import and ...

  4. input自动填入密码以后变成白色和黄色的解决办法

    问题描述: 1.谷歌自动输入账号密码以后颜色变成黄色: 解决办法: 加样式: input:-webkit-autofill { background: red !important; color: # ...

  5. Android Studio生成javadoc出错的解决办法

    一般使用Android Studio生成javadoc会有两个问题: 空指针异常 文档乱码 解决办法如下: 第1个问题:Tools --> Generate JavaDoc -->打开对话 ...

  6. Andriod学习笔记2:“Your content must have a ListView whose id attribute is 'android.R.id.list'”问题的解决办法

    问题描述 activity_main.xml代码如下: <?xml version="1.0" encoding="utf-8"?> <Lin ...

  7. Android开发遇到的异常及解决办法

    Android开发遇到的错误及解决方法1. Unable to resolve target 'android-7' 解决方案: 修改工程目录下的default.properties文件里的内容tar ...

  8. Android SDK Manager无法更新的解决办法

    Fetching https://dl-ssl.google.com/android/repository/addons_list-1.xmlFailed to fetch URL https://d ...

  9. Android 开发遇到的问题及解决办法

    Failed to resolve: com.android.support:appcompat-v7:23.4.0 问题解决办法: 1.在Android SDK Manager中找到对应的SDK版本 ...

随机推荐

  1. [整理]定义但未初始化赋值的局部变量与OXCCCCCCCC

    开发环境 : win7 32bit ,VS2010,先看一段C代码: #include <stdio.h> int main(){ int x; //-858993460 printf(& ...

  2. Asp.net操作Word文档,原来这么简单啊!

    引用Word对象库文件  具体做法是打开菜单栏中的项目>添加引用>浏览,在打开的“选择组件”对话框中找到MSWORD.OLB后按确定即可引入此对象库文件,vs.net将会自动将库文件转化为 ...

  3. es6笔记(1) 概要

    什么是ES6 ECMAScript 6.0 (简称ES6) 是继ECMAScript 5.1以后的javascript 语言的下一代标准,在2015年6月份发布. 他的目标是使javascript语言 ...

  4. MYSQL导入数据出现The MySQL server is running with the --secure-file-priv

    MYSQL导入数据出现The MySQL server is running with the --secure-file-priv option so it cannot execute this ...

  5. Python-Analysis-Malware

    Python恶意软件分析应用-PEfile 0x1.前言 要想对恶意代码快速分析,Python是一门必须要掌握的编程技能.因为它是跨平台的,而且容易阅读和编写.许多开源安全工具也是用Python写的. ...

  6. Binary Representation

    Given a (decimal - e.g. 3.72) number that is passed in as a string, return the binary representation ...

  7. 创蓝语音服务(语音通知验证码).net

    public static string PostUrl = "http://zapi.253.com/msg/HttpBatchSendSM"; static void Main ...

  8. 大数据系列之并行计算引擎Spark介绍

    相关博文:大数据系列之并行计算引擎Spark部署及应用 Spark: Apache Spark 是专为大规模数据处理而设计的快速通用的计算引擎. Spark是UC Berkeley AMP lab ( ...

  9. React-Native 之 ScrollView介绍和使用

    前言 学习本系列内容需要具备一定 HTML 开发基础,没有基础的朋友可以先转至 HTML快速入门(一) 学习 本人接触 React Native 时间并不是特别长,所以对其中的内容和性质了解可能会有所 ...

  10. C#实现语音朗读功能

    第一步:新建项目  TTS(从文本到语音(TextToSpeech)) 第二步:添加引用 System.Speech 第三步:主界面以及后台代码 using System;using System.G ...