Summary of problems when coding
来源:互联网 发布:js密码和确认密码校验 编辑:程序博客网 时间:2024/05/17 07:24
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.@Overrideprotected 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)
0 0
- Summary of problems when coding
- C++ Coding Standards:Summary of Summaries-编码风格
- Coding Interview Problems I
- Coding Interview Problems II
- Coding Interview Problems III
- PHP coding summary
- C++ Coding Standards:Summary of Summaries-组织和方针问题与设计风格
- LeetCode OJ Summary,Problems 1 - 15
- Some problems of mysql
- encode problems of browser
- Categories of performance problems
- Some Problems of FATFS
- 【c#】problems when connect baidu content API
- 1333417 - Performance problems when processing IDocs immediately
- Summary of this part
- Summary of keyword synchronized
- SUMMARY OF JANE EYRE
- SUMMARY OF CREATIONAL PATTERNS
- Oracle之常用FAQ--备份与恢复
- API中的对象Runtime
- C++primer plus第六版课后编程练习答案2.7
- 使用android SpannableStringBuilder实现图文混排源码
- Tag system implementation
- Summary of problems when coding
- 统计一个文件中的字符数,单词数,制表符。
- 自动换行LinearLayout
- Dropdownlist验证是否选择
- android 修改文本选中默认样式
- 进程与线程的一个简单解释
- 建立一个程序,写2个线程,同时对一个文件里面写入字符串,另外一个程序读取输出在控制台,保证读取的实时性。
- Cocos2d-x 常用语句
- 安卓带点击效果的圆角button