Summary of problems when coding
2015-11-24 15:15
351 查看
Git commit problems
Warning:(142, 62) Suspicious call to ‘HashMap.get’android git commit Warning:(3, 1) Default File template
Not annotated parameter overrides @NonNull parameter
It's an annotation, but the correct name is NonNull: protected void onSaveInstanceState(@NonNull Bundle outState) (And also) import android.support.annotation.NoNNull; The purpose is to allow the compiler to warn when certain assumptions are being violated (such as a parameter of a method that should always have a value, as in this particular case, although there are others). From the Support Annotations documentation: The @NonNull annotation can be used to indicate that a given parameter can not be null. If a local variable is known to be null (for example because some earlier code checked whether it was null), and you pass that as a parameter to a method where that parameter is marked as @NonNull, the IDE will warn you that you have a potential crash. They are tools for static analysis. Runtime behavior is not altered at all. In this case, the particular warning is that the original method you're overriding (in Activity) has a @NonNull annotation on the outState parameter, but you did not include it in the overriding method. Just adding it should fix the issue, i.e. @Override protected void onSaveInstanceState(@NonNull Bundle outState) { super.onSaveInstanceState(outState); }
4.BitmapDrawable() method deprecated
popupMessage.setBackgroundDrawable(null) will clear the background.
5.catch branch identical to ‘FileNotFoundException’ branch
You can collapse exception branches if they're identical, and with the multi-catch syntax, you'll wind up with one catch statement that does the same thing as your three:
RecyclerView Problem
When data changes, the view not change (Because Picasso cache)相关文章推荐
- 利用UDP传输结构体数据 structdata over udp
- schema文件中cube的事实表使用视图方法
- PHP 数组和对象的相互转化
- js防xss注入
- div距页面顶部有间隙
- 使用android SpannableStringBuilder实现图文混排源码
- 使用 Screen 创建并管理多个 shell
- SVG 在线编辑器
- Oracle之常用FAQ--备份与恢复
- [Rman]使用RMAN的Compressed Backupsets备份压缩技术
- 在线强制查看摄像头视频
- 改变页面状态码
- 谷歌官方SwipeRefreshLayout下拉刷新的用法。
- Mysql中文汉字转拼音的实现(每个汉字转换全拼)
- woocommerce自定义产品排序(无需改动代码,适合产品数量少的情况)
- if(self = (super init))的理解
- wtm32f10xx时钟系统
- 使用C++自定义Binder
- Java游戏服务器-Netty自动重连与会话管理
- Oracle之常用FAQ--Oracle 构架体系