GithubHelp home page GithubHelp logo

问一下 volatile 啥作用呢 about gank HOT 6 CLOSED

xybcoder avatar xybcoder commented on May 26, 2024
问一下 volatile 啥作用呢

from gank.

Comments (6)

xybCoder avatar xybCoder commented on May 26, 2024

volatile作为java中的关键词之一,用以声明变量的值可能随时会别的线程修改,使用volatile修饰的变量会强制将修改的值立即写入主存,主存中值的更新会使缓存中的值失效
建议你看一下java编程**

from gank.

tomridder avatar tomridder commented on May 26, 2024

嗯嗯,谢谢大佬。问一下RetrofitManager的代码都是你写的吗?看得我云里雾里。。。

from gank.

tomridder avatar tomridder commented on May 26, 2024

@Override public void onBindViewHolder(GanHuoAdapter.GanHuoHolder holder, int position) { Gank gank = gankList.get(position); holder.tvDescWithWho.setTag(gank); holder.tvDescWithWho.setText(StringStyleUtil.getGankStyleStr(gank)); }
这段代码中的setTag什么作用呢,我之前写recyclerView从来没用过

from gank.

tomridder avatar tomridder commented on May 26, 2024

你好 能否加下我的qq呢 我有些问题想要问你 1402709211

from gank.

xybCoder avatar xybCoder commented on May 26, 2024

@Override public void onBindViewHolder(GanHuoAdapter.GanHuoHolder holder, int position) { Gank gank = gankList.get(position); holder.tvDescWithWho.setTag(gank); holder.tvDescWithWho.setText(StringStyleUtil.getGankStyleStr(gank)); }
这段代码中的setTag什么作用呢,我之前写recyclerView从来没用过

settag是把数据存到控件中
在代码中有用到
@OnClick(R.id.ll_ganhuo)
void toWebClick() {
WebActivity.loadWebViewActivity(context, (Gank) tvDescWithWho.getTag());
}

from gank.

xybCoder avatar xybCoder commented on May 26, 2024

你好 能否加下我的qq呢 我有些问题想要问你 1402709211

大兄弟你是计算机专业吗

from gank.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.