我是靠谱客的博主 无聊网络,最近开发中收集的这篇文章主要介绍Summary of problems when codingGit commit problemsRecyclerView Problem,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

Git commit problems

  1. Warning:(142, 62) Suspicious call to ‘HashMap.get’
  2. android git commit Warning:(3, 1) Default File template
  3. 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

  1. When data changes, the view not change (Because Picasso cache)

最后

以上就是无聊网络为你收集整理的Summary of problems when codingGit commit problemsRecyclerView Problem的全部内容,希望文章能够帮你解决Summary of problems when codingGit commit problemsRecyclerView Problem所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(71)

评论列表共有 0 条评论

立即
投稿
返回
顶部