所以写此贴,将平时碰到的警告全部总结集中起来。
1:Handler
解决方法:
private Handler mHandler = new Handler(new Handler.Callback() {@Overridepublic 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分", Default());
警告原因:
**3:new HashMap() **
@SuppressLint("UseSparseArrays")public static Map<Integer, String> CMD_MAP = new HashMap<Integer, String>();
解决方法:
//TODO
警告原因:Use new SparseArray(…) instead for better performance
本文发布于:2024-02-04 20:28:00,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170715815159336.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |