<div class="container clearfix">
<main>
<article>
<h1 class="csdn_top">Android中关于Handle的用法和分析</h1>
<div class="article_bar clearfix">
<div class="artical_tag">
<span class="original">原创</span>
<span class="time">2016年02月28日 15:40:50</span>
</div>
<ul class="right_bar">
<li><button class="btn-noborder"><i class="icon iconfont icon-read"></i><span class="txt">586</span></button></li>
<li><button class="btn-noborder but-comment-topicon"><i class="icon iconfont icon-pinglun"></i><span class="txt">0</span></button></li>
<li><button class="btn-noborder btn-like"><i class="icon iconfont icon-xihuan-"></i><span class="txt">1</span></button></li>
<!--<li><button class="btn-noborder"><i class="icon iconfont icon-dashang-"></i><span class="txt">0</span></button></li>-->
<li class="edit" style="display: none;">
<a class="btn-noborder" href="http://write.blog.csdn.net/postedit/50760212">
<i class="icon iconfont icon-bianji"></i><span class="txt">编辑</span>
</a>
</li>
<li class="del" style="display: none;">
<a class="btn-noborder" οnclick="javascript:deleteArticle(fileName);return false;">
<i class="icon iconfont icon-shanchu"></i><span class="txt">删除</span>
</a>
</li>
</ul>
</div>
<div id="article_content" class="article_content csdn-tracking-statistics" data-mod="popu_307" data-dsm="post" style="overflow: hidden;">
<p><span style="font-size:24px">Handler</span></p>
<p><span style="font-size:18px"><strong><span style="font-size:24px">1.作用:</span></strong></span></p>
<p><span style="font-size:18px">(1). 结合<span style="font-family:Calibri">Thread</span><span style="font-family:宋体">实现连网读取数据,读取数据后更新页面,即<span style="font-family:宋体">从子线程给主线程提供一个消息报告的作用</span></span></span></p>
<p>因此主线程中一旦接收到此消息报告,即可更新页面。</p>
<p><span style="font-size:18px">(2). 指定一系列的动作排队执行</span></p>
<p><strong><span style="font-size:18px"><span style="font-size:24px">2.实现步骤:</span></span></strong></p>
<p><span style="font-size:18px">1. 创建<span style="font-family:Calibri">Handler</span></span><span style="font-family:宋体"><span style="font-size:14px"><span style="font-size:18px">对象</span></span></span></p>
<p><span style="font-size:14px; color:#FF0000">注:在<span style="font-family:Calibri">new</span><span style="font-family:宋体">对象的结尾添加</span><span style="font-family:Calibri">{}</span><span style="font-family:宋体">,并重写</span><span style="font-family:Calibri">handleMessage</span></span><span style="font-family:宋体"><span style="color:#FF0000"><span style="font-size:14px">方法</span></span></span></p>
<p><span style="font-size:18px">2. 通过<span style="font-family:Calibri">handler</span></span><span style="font-family:宋体"><span style="font-size:14px"><span style="font-size:18px">发送消息</span></span></span></p>
<p><span style="font-size:14px"> 2.1在发送消息时可选择发送空消息或者非空消息</span></p>
<p><strong><span style="font-size:14px"> 非空消息与空消息的区别:</span></strong></p>
<p><span style="font-size:14px"> 空消息中只能携带一个<span style="font-family:Calibri">int</span><span style="font-family:宋体">类型的数字</span></span></p>
<p><span style="font-size:14px"> 非空消息中除了可以携带<span style="font-family:Calibri">int</span></span><span style="font-family:宋体"><span style="font-size:14px">类型的数字外,还可携带一些其他数据</span></span></p>
<p><strong><span style="font-size:14px"> 发送消息时可选择的方法:</span></strong></p>
<p><span style="font-size:14px"> a) sendEmptyMessage<span style="font-family:宋体">(</span><span style="font-family:Calibri">int what</span><span style="font-family:宋体">)发送空消息</span></span></p>
<p><span style="font-size:14px"> 参数作用:给当前发送的消息匹配一个唯一标识 由于所有通过<span style="font-family:Calibri">handler</span><span style="font-family:宋体">对象发送的消息,最后都会到同一个</span><span style="font-family:Calibri"> handleMessage</span><span style="font-family:宋体">方法中进行接收</span></span></p>
<p><span style="font-size:14px"> 因此,为了<span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">方法中区分当前接收的消息是哪一个条</span>通过<span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">what</span><span style="font-family:宋体">属性进行判断</span></span></p>
<p><span style="font-size:14px"> b) sendMessage (Message msg) </span><span style="font-family:宋体"><span style="font-size:14px">发送非空消息</span></span></p>
<p><span style="font-size:14px"> 2.2发送步骤:</span></p>
<p><span style="font-size:14px"> 1)<span style="font-family:宋体">封装要发送的</span><span style="font-family:Calibri">Message</span><span style="font-family:宋体">对象</span></span></p>
<p><span style="font-size:14px"> 初始化方式有以下<span style="font-family:Calibri">3</span><span style="font-family:宋体">种:</span></span></p>
<p><span style="font-size:14px"> Message msg = new Message();</span></p>
<p><span style="font-size:14px"> Message msg = Message.obtain();</span></p>
<p><span style="font-size:14px"> Message msg = handler.obtainMessage();</span></p>
<p><span style="font-size:14px"> 推荐选择后两种方式的任意一种进行初始化,不推荐使用<span style="font-family:Calibri">new Message</span><span style="font-family:宋体">方法获取对象</span></span></p>
<p><span style="font-size:14px">原因:后两种方式在创建对象时会去判断内存中是否有能够直接使用的<span style="font-family:Calibri">Message</span><span style="font-family:宋体">对象,如果有,直接拿来用,</span></span></p>
<p><span style="font-size:14px">如果没有,再新建对象使用。通过后两种方式可以减少创建对象的个数,在内存方面比较优化</span></p>
<p><span style="font-size:14px"> 2) <span style="font-family:宋体">通过调用</span><span style="font-family:Calibri">msg.what = n</span><span style="font-family:宋体">(任意数字)给当前封装的</span><span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">what</span><span style="font-family:宋体">属性赋值</span></span></p>
<p><span style="font-size:14px"> 3) <span style="font-family:宋体">向</span><span style="font-family:Calibri">Message</span><span style="font-family:宋体">对象中添加要携带的数据</span></span></p>
<p><span style="font-size:14px"><strong><span id="transmark"></span>可选的添加数据的方式:</strong></span></p>
<p><span style="font-size:14px">(1) msg.obj = Object(<span style="font-family:宋体">任意类型的对象</span><span style="font-family:Calibri">) </span><span style="font-family:宋体">给</span><span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">obj</span><span style="font-family:宋体">属性赋值</span></span></p>
<p><span style="font-size:14px">(2) 通过<span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">arg1</span><span style="font-family:宋体">和</span><span style="font-family:Calibri">arg2</span><span style="font-family:宋体">属性携带数据,添加数据的方式与</span><span style="font-family:Calibri">obj</span><span style="font-family:宋体">属性相同</span>msg.<span style="font-family:宋体">属性名 </span><span style="font-family:Calibri">= </span><span style="font-family:宋体">赋值;</span></span></p>
<p><span style="font-size:14px"> 此两条属性只能携带<span style="font-family:Calibri">int</span><span style="font-family:宋体">类型的数据</span></span></p>
<p><span style="font-size:14px">(3) 通过<span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">setData(Bundle args)</span><span style="font-family:宋体">方法携带数据</span></span></p>
<p><span style="font-size:14px"><strong>对应的取出数据的方式:</strong></span></p>
<p><span style="font-size:14px">在<span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">方法中,通过参数</span><span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象</span></span></p>
<p><span style="font-size:14px">(1) Object o = msg.obj; <span style="font-family:宋体">取出</span><span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">obj</span><span style="font-family:宋体">属性的值</span></span></p>
<p><span style="font-size:14px">注:接收该属性的对象可以按需求写成任意类型</span></p>
<p><span style="font-size:14px">如,接收的是一个<span style="font-family:Calibri">Bitmap</span><span style="font-family:宋体">图片数据</span></span></p>
<p><span style="font-size:14px">则可:<span style="font-family:Calibri">Bitmap o= </span><span style="font-family:宋体">(</span><span style="font-family:Calibri">Bitmap</span><span style="font-family:宋体">)</span><span style="font-family:Calibri">msg.obj;</span></span></p>
<p><span style="font-size:14px">(2) 通过<span style="font-family:Calibri">msg.arg1</span><span style="font-family:宋体">进行取值即可</span></span></p>
<p><span style="font-size:14px">(3) 通过<span style="font-family:Calibri">msg.getData </span><span style="font-family:宋体">先取出传递过来的</span><span style="font-family:Calibri">Bundle</span><span style="font-family:宋体">对象,然后通过</span><span style="font-family:Calibri">Bundle</span>对象调用<span style="font-family:Calibri">get</span><span style="font-family:宋体">方法根据</span><span style="font-family:Calibri">key</span><span style="font-family:宋体">取出对应的</span></span><span style="font-family:Calibri"><span style="font-size:14px">value</span></span></p>
<p><span style="font-size:14px"><strong>应该在什么情况下选择哪种方式携带数据?</strong></span></p>
<p><span style="font-size:14px">1. 如果要携带的数据的类型和个数不超出<span style="font-family:Calibri">2</span><span style="font-family:宋体">个</span><span style="font-family:Calibri">int</span><span style="font-family:宋体">和</span><span style="font-family:Calibri">1</span><span style="font-family:宋体">个任意类型时,推荐直接使用对应的属性进行携带</span></span></p>
<p><span style="font-size:14px">2. 如果要携带的数据的类型或者个数超出上述的限制,那么使用<span style="font-family:Calibri">setData</span><span style="font-family:宋体">方法进行携带</span></span></p>
<p><span style="font-size:14px">3. 在<span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">中接收通过</span><span style="font-family:Calibri">sendEmptyMessage</span><span style="font-family:宋体">或者通过</span><span style="font-family:Calibri">sendMessage</span><span style="font-family:宋体">方法发送过来的消息</span></span></p>
<p><span style="font-size:14px">4. 通过<span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">方法中的参数</span><span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象获取</span><span style="font-family:Calibri">msg.what</span></span><span style="font-family:宋体"><span style="font-size:14px">属性的值即可区分当前接收的是哪一个发送过来的消息</span></span></p>
<p><strong><span style="font-size:18px">使用<span style="font-family:Calibri">Handler</span></span></strong><span style="font-family:宋体"><strong><span style="font-size:18px">时的注意事项:</span></strong></span></p>
<p><span style="font-size:14px">1. handleMessage<span style="font-family:宋体">名称不要写错,参数列数不要修改</span></span></p>
<p><span style="font-size:14px">2. 在初始化<span style="font-family:Calibri">Handler</span><span style="font-family:宋体">对象,重写</span><span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">方法的时候,注意不要写成以下格式:</span></span></p>
<p><span style="font-size:14px">3. 在一个<span style="font-family:Calibri">Activity</span><span style="font-family:宋体">中支持创建多个</span><span style="font-family:Calibri">Handler</span><span style="font-family:宋体">对象,当发送消息后,由哪个</span><span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">方法进行消息的处理,取决于发送消息的对象是哪个</span><span style="font-family:Calibri">------</span><span style="font-family:宋体">哪个</span><span style="font-family:Calibri">handler</span><span style="font-family:宋体">对象发送的消息,就有哪个</span><span style="font-family:Calibri">handler</span><span style="font-family:宋体">对象进行消息的处理</span></span></p>
<p><span style="font-size:14px">4. handler<span style="font-family:宋体">对象的发送消息方法并不会阻塞主线程的运行,即</span>如果在发送消息的代码后方有其他代码,那么不会等到消息处理完后再后续代码,而是直接运行后续代码</span></p>
<link rel="stylesheet" href="http://static.blog.csdn.net/public/res-min/markdown_views.css?v=2.0">
</div>
</article>
<div class="readall_box csdn-tracking-statistics readall_box_nobg" data-mod="popu_376" style="display: none;">
<a class="btn btn-large btn-gray-fred read_more_btn" target="_self">阅读全文</a>
</div>
<div class="article_copyright">
版权声明:本文为博主原创文章,未经博主允许不得转载。
<span class="r_ico"><i class="icon iconfont icon-jubao"></i><span class="txt" id="reportBtn">举报</span></span>
</div>
<!-- <div class="reward_box">
<div class="tit">
<button class="btn_reward"><i class="icon iconfont icon-dashang-"></i></button>
</div>
<dl class="clearfix">
<dt><a href="#" target="_blank">近期打赏</a></dt>
<dd><a href="#" target="_blank"><img src="http://avatar.csdn.net/9/3/2/2_nzf_001.jpg" alt="聂兆芳" title="聂兆芳"></a></dd>
<dd><a href="#" target="_blank"><img src="http://avatar.csdn.net/9/3/2/2_nzf_001.jpg" alt="聂兆芳" title="聂兆芳"></a></dd>
<dd><a href="#" target="_blank"><img src="http://avatar.csdn.net/9/3/2/2_nzf_001.jpg" alt="聂兆芳" title="聂兆芳"></a></dd>
<dd><a href="#" target="_blank"><img src="http://avatar.csdn.net/9/3/2/2_nzf_001.jpg" alt="聂兆芳" title="聂兆芳"></a></dd>
<dd><a href="#" target="_blank"><img src="http://avatar.csdn.net/9/3/2/2_nzf_001.jpg" alt="聂兆芳" title="聂兆芳"></a></dd>
</dl>
</div>-->
<ul class="article_tags clearfix csdn-tracking-statistics" data-mod="popu_377">
<li class="tit">标签:</li>
<li><a href="http://so.csdn.net/so/search/s.do?q=androispan idtransma&t=blog" target="_blank">androispan idtransma</a> <span>/</span></li>
<li><a href="http://so.csdn.net/so/search/s.do?q=androidspan idtransm&t=blog" target="_blank">androidspan idtransm</a> <span>/</span></li>
<li><a href="http://so.csdn.net/so/search/s.do?q=Handle机span idtransm&t=blog" target="_blank">Handle机span idtransm</a> <span>/</span></li>
</ul>
<ul class="article_collect clearfix csdn-tracking-statistics" data-mod="popu_378" style="display: none;">
<li class="tit">本文已收录于以下专栏:</li>
</ul>
<div class="comment_box clearfix">
<div id="comment_form">
<div id="commentsbmitarear">
<!-- <h6><span>0</span>条评论</h6> -->
<!-- <dl class="clearfix" id="commentbox">
<dt>
<a href="http://my.csdn.net/lybcosplay"><img src="http://avatar.csdn.net/B/E/7/1_lybcosplay.jpg" ></a>
</dt>
<dd>
<a href="http://my.csdn.net/lybcosplay" target="_blank">lybcosplay</a>
</dd>
<dd class="txt_tip"><span id="tip_comment" class="tip"></span></dd>
</dl> -->
<div class="comment_area clearfix" style="height: 82px;">
<div class="userimg"><a href="http://my.csdn.net/lybcosplay"><img src="http://avatar.csdn.net/B/E/7/1_lybcosplay.jpg"></a></div>
<form action="/u013010578/comment/submit?id=50760212" method="post" οnsubmit="return subform(this);" id="commentform">
<textarea class="comment_content" name="comment_content" id="comment_content" placeholder="发表你的评论" style="height: 40px;"></textarea>
<div class="bot_bar clearfix" style="opacity: 0;">
<div id="ubbtools" class="add_code">
<a href="#insertcode" code="code" target="_self"><i class="icon iconfont icon-daima"></i></a>
</div>
<input type="hidden" id="comment_replyId" name="comment_replyId">
<input type="hidden" id="comment_userId" name="comment_userId" value="">
<input type="hidden" id="commentId" name="commentId" value="">
<input type="submit" class="btn btn-redborder" value="发表评论">
<span id="tip_comment" class="tip">
<div style="display: none;" class="csdn-tracking-statistics" data-mod="popu_384"><a href="#" target="_blank" class="comment_area_btn">发表评论</a></div>
<div id="lang_list" code="code">
<a href="#html" style="width:95px;" class="long_name" target="_self">HTML/XML</a>
<a href="#objc" style="width:95px;" class="long_name" target="_self">objective-c</a>
<a href="#delphi" style="width:58px;" class="zhong_name" target="_self">Delphi</a>
<a href="#ruby" class="zhong_name" target="_self">Ruby</a>
<a href="#php" target="_self">PHP</a>
<a href="#csharp" class="duan_name" target="_self">C#</a>
<a style=" border-right: none;" href="#cpp" class="duan_name" target="_self">C++</a>
<a style=" border-bottom:none;width:95px;" href="#javascript" class="long_name" target="_self">JavaScript</a>
<a style=" border-bottom:none;width:95px;" href="#vb" class="long_name" target="_self">Visual Basic</a>
<a style=" border-bottom:none;" href="#python" class="zhong_name" target="_self">Python</a>
<a style=" border-bottom:none;" href="#java" class="zhong_name" target="_self">Java</a>
<a style="border-bottom:none;" href="#css" class="duan_name" target="_self">CSS</a>
<a style="border-bottom:none;" href="#sql" class="duan_name" target="_self">SQL</a>
<a style="border:none; " href="#plain" class="duan_name" target="_self">其它</a>
<span class="arrb"></span>
</div>
</span></div>
</form>
</div>
</div>
</div>
</div>
<div class="comment_li_outbox"><div style="display:none"><br> 暂无评论<br><br><div class="clear"></div></div></div>
<div class="more_comment" style="display: none;">
<div id="comment_bar" class="trackgin-ad" data-mod="popu_385"></div>
</div>
<h3 class="recommend_tit">相关文章推荐</h3>
<div class="recommend_list clearfix">
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/bruce_wang_janet/article/details/41778871" target="_blank" strategy="BlogCommendFromBaidu_0">android handle 用法</a></h2>
<div class="summary">
方法一:(java习惯,在android平台开发时这样是不行的,因为它违背了单线程模型)
刚刚开始接触android线程编程的时候,习惯好像java一样,试图用下面的代码解决问题
new...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/bruce_wang_janet" target="_blank" strategy="BlogCommendFromBaidu_0"><img src="http://avatar.csdn.net/1/B/4/2_bruce_wang_janet.jpg" alt="bruce_wang_janet" title="bruce_wang_janet"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/bruce_wang_janet" target="_blank">bruce_wang_janet</a></li>
<li class="time">2014-12-06 21:15</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>3865</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/u013010578/article/details/50760212" target="_blank" strategy="BlogCommendFromCsdn_1">Android中关于Handle的用法和分析</a></h2>
<div class="summary">
Handler
1.作用:
(1). 结合Thread实现连网读取数据,读取数据后更新页面,即从子线程给主线程提供一个消息报告的作用
因此主线程中一旦接收到此消息报告,即可更新页面。
(2)....
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/u013010578" target="_blank" strategy="BlogCommendFromCsdn_1"><img src="http://avatar.csdn.net/E/B/5/2_u013010578.jpg" alt="u013010578" title="u013010578"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/u013010578" target="_blank">u013010578</a></li>
<li class="time">2016-02-28 15:40</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>586</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_393">
<dt><a href="http://edu.csdn.net/huiyiCourse/series_detail/61?utm_source=blog10" target="_blank"><img class="maxwidth" src="https://img-blog.csdn.net/20170913101427008" alt="" title=""></a></dt>
<dd>
<div class="summary">
<h2><a href="http://edu.csdn.net/huiyiCourse/series_detail/61?utm_source=blog10" target="_blank">如何成为一名机器学习的大咖?</a></h2> <div class="summary">对于机器学习,很多人的观点是:机器学习技术是今后所有技术人员都绕不过的一个门槛。 那么,普通程序员该学习机器学作为一名对机器学习心有向往的程序员,我该以什么样的姿势开始呢?</div>
</div>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/xiang_pao/article/details/20949199" target="_blank" strategy="BlogCommendFromCsdn_2">关于Android Handle的用法</a></h2>
<div class="summary">
一、Handler的定义:
主要接受子线程发送的数据,
并用此数据配合主线程更新UI.
解释: 当应用程序启动时,Android首先会开启一个主线程
(也就是UI线...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/xiang_pao" target="_blank" strategy="BlogCommendFromCsdn_2"><img src="http://avatar.csdn.net/C/4/B/2_xiang_pao.jpg" alt="xiang_pao" title="xiang_pao"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/xiang_pao" target="_blank">xiang_pao</a></li>
<li class="time">2014-03-10 20:38</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>252</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/s2311307/article/details/76769468" target="_blank" strategy="BlogCommendFromCsdn_3">分析Android中Handle机制</a></h2>
<div class="summary">
上次浅分析了android中的绘画机制,今天我们来谈谈,android中的Handle机制。在一开始学习Android的时候,总会遇见一个问题,更新UI只能在主线程中进行,而有时候做耗时操作(耗时操作...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/s2311307" target="_blank" strategy="BlogCommendFromCsdn_3"><img src="http://avatar.csdn.net/9/F/3/2_s2311307.jpg" alt="s2311307" title="s2311307"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/s2311307" target="_blank">s2311307</a></li>
<li class="time">2017-08-06 14:59</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>35</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/sinat_32869075/article/details/50826220" target="_blank" strategy="BlogCommendFromCsdn_4">android中Handle类的用法</a></h2>
<div class="summary">
当我们在处理下载或是其他需要长时间执行的任务时,如果直接把处理函数放Activity的OnCreate或是OnStart中,会导致执行过程中整个Activity无响应,如果时间过长,程序还会挂掉。Ha...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/sinat_32869075" target="_blank" strategy="BlogCommendFromCsdn_4"><img src="http://avatar.csdn.net/4/6/6/2_sinat_32869075.jpg" alt="sinat_32869075" title="sinat_32869075"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/sinat_32869075" target="_blank">sinat_32869075</a></li>
<li class="time">2016-03-08 12:32</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>207</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/dai_jing/article/details/8892452" target="_blank" strategy="BlogCommendFromCsdn_5">关于c++static关键字和extern关键字</a></h2>
<div class="summary">
1.static用于变量
当我们将变量声明为static类型,如:static int n=0,这就告诉编译器记住第一次的声明,以后再重复使用时不再声明,相当于在文件内定义一个全局变量下面给出一个例...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/dai_jing" target="_blank" strategy="BlogCommendFromCsdn_5"><img src="http://avatar.csdn.net/B/5/A/2_dai_jing.jpg" alt="dai_jing" title="dai_jing"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/dai_jing" target="_blank">dai_jing</a></li>
<li class="time">2013-05-06 21:42</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>578</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/ydx115600497/article/details/50994434" target="_blank" strategy="BlogCommendFromCsdn_6">Android中handle用法总结</a></h2>
<div class="summary">
一、Handle 的定义
Handler主要接收子线程发送的数据, 并用此数据配合主线程更新UI,用来跟UI主线程交互用。比如可以用handler发送一个message,然后...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/ydx115600497" target="_blank" strategy="BlogCommendFromCsdn_6"><img src="http://avatar.csdn.net/8/1/0/2_ydx115600497.jpg" alt="ydx115600497" title="ydx115600497"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/ydx115600497" target="_blank">ydx115600497</a></li>
<li class="time">2016-03-27 22:22</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>552</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/qq_33777090/article/details/51365373" target="_blank" strategy="BlogCommendFromCsdn_7">关于NSRunLoop和NSTimer的深入理解</a></h2>
<div class="summary">
关于NSRunLoop和NSTimer的深入理解
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/qq_33777090" target="_blank" strategy="BlogCommendFromCsdn_7"><img src="http://avatar.csdn.net/3/B/0/2_qq_33777090.jpg" alt="qq_33777090" title="qq_33777090"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/qq_33777090" target="_blank">qq_33777090</a></li>
<li class="time">2016-05-10 18:06</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>120</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/u013868143/article/details/54288247" target="_blank" strategy="BlogCommendFromCsdn_8">Android开发 -- 关于RecylerView的使用和RecylerViewAdapter的实现及监听</a></h2>
<div class="summary">
在学习Android基础的时候,碰到过listView,那么在进阶的时候,发现RecyclerView控件。
在现在的主流APP有许多在使用着RecyclerView,所以今天我们来看看Recyle...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/u013868143" target="_blank" strategy="BlogCommendFromCsdn_8"><img src="http://avatar.csdn.net/F/D/6/2_u013868143.jpg" alt="u013868143" title="u013868143"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/u013868143" target="_blank">u013868143</a></li>
<li class="time">2017-01-09 13:53</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>82</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/zyttae/article/details/44926393" target="_blank" strategy="BlogCommendFromCsdn_9">关于MFC中的#ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #endif</a></h2>
<div class="summary">
情况1:
#ifdef _DEBUG
virtual void AssertValid() const; //assert(断言)valid(有效的,正确的)
virtual void Dump...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/ZYTTAE" target="_blank" strategy="BlogCommendFromCsdn_9"><img src="http://avatar.csdn.net/3/C/6/2_zyttae.jpg" alt="ZYTTAE" title="ZYTTAE"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/ZYTTAE" target="_blank">ZYTTAE</a></li>
<li class="time">2015-04-07 21:49</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>682</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/renyuanrenyuan/article/details/7671507" target="_blank" strategy="BlogCommendFromCsdn_10">android 中的handle</a></h2>
<div class="summary">
http://www.cnblogs.com/GodBlessMe/archive/2011/04/16/2017840.html
android学习笔记之消息机制
有...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/renyuanrenyuan" target="_blank" strategy="BlogCommendFromCsdn_10"><img src="http://avatar.csdn.net/0/A/D/2_renyuanrenyuan.jpg" alt="renyuanrenyuan" title="renyuanrenyuan"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/renyuanrenyuan">renyuanrenyuan</a></li>
<li class="time">2012-06-17 19:48</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>66</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/u010550007/article/details/46364215" target="_blank" strategy="BlogCommendFromCsdn_11">Android中Handle的作用</a></h2>
<div class="summary">
今天遇到一篇写的浅显易懂的文章,特别贴出来。
在Android的UI开发中,我们经常会使用Handler来控制主UI程序的界面变化。有关Handler的作用,我们总结为:与其他线程协同工作,接收...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/u010550007" target="_blank" strategy="BlogCommendFromCsdn_11"><img src="http://avatar.csdn.net/6/E/8/2_u010550007.jpg" alt="u010550007" title="u010550007"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/u010550007">u010550007</a></li>
<li class="time">2015-06-04 16:58</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>375</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/li_huifeng/article/details/8280792" target="_blank" strategy="BlogCommendFromCsdn_12">Objective-C 关于 self 的用法总结</a></h2>
<div class="summary">
原文来自:OSChina
今天新同事问了一些关于什么时候用全局变量,什么时候用self.赋值的问题,所以笔者在此说明一下。
何时使用self.在网上搜索或者论坛里的回复大多都是简简单单的说...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/Li_Huifeng" target="_blank" strategy="BlogCommendFromCsdn_12"><img src="http://avatar.csdn.net/F/8/B/2_li_huifeng.jpg" alt="Li_Huifeng" title="Li_Huifeng"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/Li_Huifeng">Li_Huifeng</a></li>
<li class="time">2012-12-11 09:08</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>1049</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/chris_leeyc/article/details/41787297" target="_blank" strategy="BlogCommendFromCsdn_13">关于RAM的一点小见解</a></h2>
<div class="summary">
众所周知,存储器主要分为只读存储器(ROM)、闪存(flash)、随机存储器(RAM)、光磁介质存储器。
而对于随机存储器(Random-Access Memory),即我们平时所说的RAM,他和只...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/chris_leeYC" target="_blank" strategy="BlogCommendFromCsdn_13"><img src="http://avatar.csdn.net/2/0/8/2_chris_leeyc.jpg" alt="chris_leeYC" title="chris_leeYC"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/chris_leeYC">chris_leeYC</a></li>
<li class="time">2014-12-07 14:17</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>310</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/lif1234567890/article/details/54142663" target="_blank" strategy="BlogCommendFromCsdn_14">关于__vectorcall的使用</a></h2>
<div class="summary">
关于__vectorcall的使用
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/lif12345" target="_blank" strategy="BlogCommendFromCsdn_14"><img src="http://avatar.csdn.net/E/0/7/2_lif12345.jpg" alt="lif12345" title="lif12345"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/lif12345">lif12345</a></li>
<li class="time">2017-01-06 21:27</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>304</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/lihuacui/article/details/52673398" target="_blank" strategy="BlogCommendFromCsdn_15">关于C++中的句柄(handle)</a></h2>
<div class="summary">
(来自:http://blog.163.com/shaochx@126/blog/static/202195182009111101932975/)
1.句柄是什么?
在windows...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/lihuacui" target="_blank" strategy="BlogCommendFromCsdn_15"><img src="http://avatar.csdn.net/2/E/9/2_lihuacui.jpg" alt="lihuacui" title="lihuacui"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/lihuacui">lihuacui</a></li>
<li class="time">2016-09-26 20:01</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>69</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/tianxiangshan/article/details/7807230" target="_blank" strategy="BlogCommendFromCsdn_16">handle的用法</a></h2>
<div class="summary">
Handler是Android消息模型最重要的一个概念,它可以说是Android消息模型的核心,对于Looper、MessageQueue、Message 等概念一般在应用中很少使用。在Android...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/tianxiangshan" target="_blank" strategy="BlogCommendFromCsdn_16"><img src="http://avatar.csdn.net/2/3/1/2_tianxiangshan.jpg" alt="tianxiangshan" title="tianxiangshan"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/tianxiangshan">tianxiangshan</a></li>
<li class="time">2012-07-31 13:16</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>1808</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/jolin678/article/details/50010989" target="_blank" strategy="BlogCommendFromCsdn_17">关于WM_NOTIFY的使用方法</a></h2>
<div class="summary">
关于WM_NOTIFY的使用方法
切记:此消息只发给它的父窗口,再要发给父窗口的父窗口或主框架窗口等...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/jolin678" target="_blank" strategy="BlogCommendFromCsdn_17"><img src="http://avatar.csdn.net/A/E/9/2_jolin678.jpg" alt="jolin678" title="jolin678"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/jolin678">jolin678</a></li>
<li class="time">2015-11-24 12:28</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>180</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/qq_28739633/article/details/46360489" target="_blank" strategy="BlogCommendFromCsdn_18">文章标题</a></h2>
<div class="summary">
关于用研方法的心得 现实工作中用户的需求会千奇百怪,再加上数据采集,业务部门的反馈,尝尝会让很多产品经理迷失在自己的世界里,而产品不可能大而全的满足所有用户的所有需求,这点虽然是老生常谈,但仍屡见不...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/qq_28739633" target="_blank" strategy="BlogCommendFromCsdn_18"><img src="http://avatar.csdn.net/4/2/F/2_qq_28739633.jpg" alt="qq_28739633" title="qq_28739633"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/qq_28739633">qq_28739633</a></li>
<li class="time">2015-06-04 14:09</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>115</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/irelandken/article/details/6927249" target="_blank" strategy="BlogCommendFromCsdn_19">关于JSP里JavaBean的用法分析</a></h2>
<div class="summary">
关于JSP里JavaBean的用法分析:我们可以使用Scriptlet的方式: /
还可以用的方式//bean.HelloBean.java:
package bean;
public cl...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/irelandken" target="_blank" strategy="BlogCommendFromCsdn_19"><img src="http://avatar.csdn.net/F/C/E/2_irelandken.jpg" alt="irelandken" title="irelandken"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/irelandken">irelandken</a></li>
<li class="time">2011-11-02 09:49</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>2176</span></li>
</ul>
</dd>
</dl>
</div>
</main>
<aside>
<div class="right_box user_info">
<dl class="inf_bar clearfix">
<dt class="csdn-tracking-statistics" data-mod="popu_381">
<a href="http://blog.csdn.net/u013010578" target="_blank">
<img src="http://avatar.csdn.net/E/B/5/1_u013010578.jpg" class="avatar_pic">
</a>
<span class="medals" title="">
<svg class="icon" aria-hidden="true">
</svg>
</span>
</dt>
<dd>
<h3 class="csdn-tracking-statistics" data-mod="popu_380"><a href="http://blog.csdn.net/u013010578" target="_blank" id="uid">张慧彪</a></h3>
<span class="csdn-tracking-statistics" data-mod="popu_379"><a class="btn btn-redborder-small " id="span_add_follow" target="_self">+关注</a></span>
</dd>
</dl>
<div class="inf_number_box clearfix">
<dl>
<dt>原创</dt>
<dd>15</dd>
</dl>
<dl>
<dt>粉丝</dt>
<dd>0</dd>
</dl>
<dl>
<dt>喜欢</dt>
<dd>0</dd>
</dl>
<dl>
<dt>码云</dt>
<dd><a href="https://gitee.com/fsrc_648?utm_source=csdn_blog" target="_blank">0</a></dd>
</dl>
</div>
<div class="writings">
<div class="public_signal clearfix">
<h3>他的最新文章</h3>
<a href="http://blog.csdn.net/u013010578" target="_blank" class="more"><span>更多文章</span></a>
</div>
<ul class="inf_list clearfix csdn-tracking-statistics" data-mod="popu_382">
<li class="clearfix">
<a href="/u013010578/article/details/50760085" target="_blank">有关Loader加载器的使用方法和总结</a>
</li>
<li class="clearfix">
<a href="/u013010578/article/details/50628363" target="_blank">对安卓中Handle机制的一些见解</a>
</li>
<li class="clearfix">
<a href="/u013010578/article/details/50626048" target="_blank">java中线程与进程的一些总结</a>
</li>
</ul>
</div>
</div>
<div class="extension_other csdn-tracking-statistics" data-mod="popu_389">
<!--u3032528-->
<div class="flashrecommend">
<div id="_bg70lht576g06bt9" style=""><div style="cursor:auto;"><div id="oiqsfbclwy" class="mwxhbdcwmem" style="display:none;"></div><iframe width="300" frameborder="0" height="250" scrolling="no" src="http://mpb2.iteye.com/swumv?czd=472&rdy=522&yd=w525474A&gop=jvvrb5Cb4Hb4Hdnqib.eufpb.pgvb4Hw23523279Ab4Hctvkengb4Hfgvcknub4H72982434&yx=4&zskn=333223&yvd=3&vmd=4&ydn=2&vio=3&okm=372785A527296&yoh=JVON.RQUV"></iframe></div></div><script type="text/javascript" src="http://mpb1.iteye.com/bwocoltlyzdec.js"></script>
</div>
</div>
<div class="new_column right_box" style="display:none">
<h3 class="tit recommend_btn"><span><em>编辑推荐</em></span></h3>
<h3 class="tit new_btn"><span><em>最热专栏</em></span></h3>
<ul class="csdn-tracking-statistics new" data-mod="popu_434">
<li><a href="http://blog.csdn.net/column/details/16138.html" target="_blank">史上最简单的 MySQL 教程</a></li>
<li><a href="http://blog.csdn.net/column/details/13761.html" target="_blank">区块链开发技术分享</a></li>
<li><a href="http://blog.csdn.net/column/details/14531.html" target="_blank">死磕Java</a></li>
<li><a href="http://blog.csdn.net/column/details/16036.html" target="_blank">ARKit开发</a></li>
<li><a href="http://blog.csdn.net/column/details/15938.html" target="_blank">从高考到程序员</a></li>
</ul>
<ul class="recommend csdn-tracking-statistics " data-mod="popu_434">
<li><a href="#" target="_blank">编辑推荐编辑推荐编辑推荐编辑推荐编辑推荐</a></li>
</ul>
</div>
<div class="fixRight" style="position: fixed; top: 0px; left: 956.5px;">
<div class="right_box padb0 csdn-tracking-statistics" data-mod="popu_391">
<h3 class="tit"><span><em>在线课程</em></span></h3>
<ul class="edu_li clearfix">
<li>
<div>
<a href="http://edu.csdn.net/huiyiCourse/series_detail/61?utm_soruce=blog9" target="_blank">
<img src="http://img.bss.csdn.net/201709151721463908.png" alt="30天系统掌握机器学习" title="30天系统掌握机器学习">
</a>
</div>
<div>
<p><a href="http://edu.csdn.net/huiyiCourse/series_detail/61?utm_soruce=blog9" target="_blank">30天系统掌握机器学习</a></p>
<p>讲师:唐宇迪</p>
</div>
</li>
<li>
<div>
<a href="http://edu.csdn.net/huiyiCourse/detail/564?utm_source=blog9" target="_blank">
<img src="http://img.bss.csdn.net/201709151720108254.jpg" alt="【免费】XGBoost模型原理及其表现" title="【免费】XGBoost模型原理及其表现">
</a>
</div>
<div>
<p><a href="http://edu.csdn.net/huiyiCourse/detail/564?utm_source=blog9" target="_blank">【免费】XGBoost模型原理及其表现</a></p>
<p>讲师:卿来云</p>
</div>
</li>
</ul>
</div>
<!--u3032529-->
<!-- <div class="extension_other csdn-tracking-statistics baidu_box" data-mod="popu_395">
<script type="text/javascript" src="http://mpb1.iteye.com/cxpdpmumfaedgm.js"></script>
</div> -->
<div class="extension_other csdn-tracking-statistics bottomRcom" data-mod="popu_389" style="position:relative;z-index:-5;opacity:0;pointer-events:none">
<!--u3032528-->
<div class="flashrecommend">
<div style=""><iframe width="300" frameborder="0" height="250" scrolling="no" src="//mpb2.iteye.com/jyvir?czd=472&rdy=522&yd=w525474A&gop=jvvrb5Cb4Hb4Hdnqib.eufpb.pgvb4Hw23523279Ab4Hctvkengb4Hfgvcknub4H72982434&ydn=2&yx=4&vmd=4&yoh=JVON.RQUV&okm=372785A527296&yvd=4&vio=3&zskn=333223&11=v3me6lmcxr&a8=ybcvcuwhfr&l7=mfbkvuz0k9"></iframe></div><script type="text/javascript" src="http://mpb1.iteye.com/bwocoltlyzdec.js"></script>
</div>
</div>
</div>
</aside>
</div>
<main>
<article>
<h1 class="csdn_top">Android中关于Handle的用法和分析</h1>
<div class="article_bar clearfix">
<div class="artical_tag">
<span class="original">原创</span>
<span class="time">2016年02月28日 15:40:50</span>
</div>
<ul class="right_bar">
<li><button class="btn-noborder"><i class="icon iconfont icon-read"></i><span class="txt">586</span></button></li>
<li><button class="btn-noborder but-comment-topicon"><i class="icon iconfont icon-pinglun"></i><span class="txt">0</span></button></li>
<li><button class="btn-noborder btn-like"><i class="icon iconfont icon-xihuan-"></i><span class="txt">1</span></button></li>
<!--<li><button class="btn-noborder"><i class="icon iconfont icon-dashang-"></i><span class="txt">0</span></button></li>-->
<li class="edit" style="display: none;">
<a class="btn-noborder" href="http://write.blog.csdn.net/postedit/50760212">
<i class="icon iconfont icon-bianji"></i><span class="txt">编辑</span>
</a>
</li>
<li class="del" style="display: none;">
<a class="btn-noborder" οnclick="javascript:deleteArticle(fileName);return false;">
<i class="icon iconfont icon-shanchu"></i><span class="txt">删除</span>
</a>
</li>
</ul>
</div>
<div id="article_content" class="article_content csdn-tracking-statistics" data-mod="popu_307" data-dsm="post" style="overflow: hidden;">
<p><span style="font-size:24px">Handler</span></p>
<p><span style="font-size:18px"><strong><span style="font-size:24px">1.作用:</span></strong></span></p>
<p><span style="font-size:18px">(1). 结合<span style="font-family:Calibri">Thread</span><span style="font-family:宋体">实现连网读取数据,读取数据后更新页面,即<span style="font-family:宋体">从子线程给主线程提供一个消息报告的作用</span></span></span></p>
<p>因此主线程中一旦接收到此消息报告,即可更新页面。</p>
<p><span style="font-size:18px">(2). 指定一系列的动作排队执行</span></p>
<p><strong><span style="font-size:18px"><span style="font-size:24px">2.实现步骤:</span></span></strong></p>
<p><span style="font-size:18px">1. 创建<span style="font-family:Calibri">Handler</span></span><span style="font-family:宋体"><span style="font-size:14px"><span style="font-size:18px">对象</span></span></span></p>
<p><span style="font-size:14px; color:#FF0000">注:在<span style="font-family:Calibri">new</span><span style="font-family:宋体">对象的结尾添加</span><span style="font-family:Calibri">{}</span><span style="font-family:宋体">,并重写</span><span style="font-family:Calibri">handleMessage</span></span><span style="font-family:宋体"><span style="color:#FF0000"><span style="font-size:14px">方法</span></span></span></p>
<p><span style="font-size:18px">2. 通过<span style="font-family:Calibri">handler</span></span><span style="font-family:宋体"><span style="font-size:14px"><span style="font-size:18px">发送消息</span></span></span></p>
<p><span style="font-size:14px"> 2.1在发送消息时可选择发送空消息或者非空消息</span></p>
<p><strong><span style="font-size:14px"> 非空消息与空消息的区别:</span></strong></p>
<p><span style="font-size:14px"> 空消息中只能携带一个<span style="font-family:Calibri">int</span><span style="font-family:宋体">类型的数字</span></span></p>
<p><span style="font-size:14px"> 非空消息中除了可以携带<span style="font-family:Calibri">int</span></span><span style="font-family:宋体"><span style="font-size:14px">类型的数字外,还可携带一些其他数据</span></span></p>
<p><strong><span style="font-size:14px"> 发送消息时可选择的方法:</span></strong></p>
<p><span style="font-size:14px"> a) sendEmptyMessage<span style="font-family:宋体">(</span><span style="font-family:Calibri">int what</span><span style="font-family:宋体">)发送空消息</span></span></p>
<p><span style="font-size:14px"> 参数作用:给当前发送的消息匹配一个唯一标识 由于所有通过<span style="font-family:Calibri">handler</span><span style="font-family:宋体">对象发送的消息,最后都会到同一个</span><span style="font-family:Calibri"> handleMessage</span><span style="font-family:宋体">方法中进行接收</span></span></p>
<p><span style="font-size:14px"> 因此,为了<span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">方法中区分当前接收的消息是哪一个条</span>通过<span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">what</span><span style="font-family:宋体">属性进行判断</span></span></p>
<p><span style="font-size:14px"> b) sendMessage (Message msg) </span><span style="font-family:宋体"><span style="font-size:14px">发送非空消息</span></span></p>
<p><span style="font-size:14px"> 2.2发送步骤:</span></p>
<p><span style="font-size:14px"> 1)<span style="font-family:宋体">封装要发送的</span><span style="font-family:Calibri">Message</span><span style="font-family:宋体">对象</span></span></p>
<p><span style="font-size:14px"> 初始化方式有以下<span style="font-family:Calibri">3</span><span style="font-family:宋体">种:</span></span></p>
<p><span style="font-size:14px"> Message msg = new Message();</span></p>
<p><span style="font-size:14px"> Message msg = Message.obtain();</span></p>
<p><span style="font-size:14px"> Message msg = handler.obtainMessage();</span></p>
<p><span style="font-size:14px"> 推荐选择后两种方式的任意一种进行初始化,不推荐使用<span style="font-family:Calibri">new Message</span><span style="font-family:宋体">方法获取对象</span></span></p>
<p><span style="font-size:14px">原因:后两种方式在创建对象时会去判断内存中是否有能够直接使用的<span style="font-family:Calibri">Message</span><span style="font-family:宋体">对象,如果有,直接拿来用,</span></span></p>
<p><span style="font-size:14px">如果没有,再新建对象使用。通过后两种方式可以减少创建对象的个数,在内存方面比较优化</span></p>
<p><span style="font-size:14px"> 2) <span style="font-family:宋体">通过调用</span><span style="font-family:Calibri">msg.what = n</span><span style="font-family:宋体">(任意数字)给当前封装的</span><span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">what</span><span style="font-family:宋体">属性赋值</span></span></p>
<p><span style="font-size:14px"> 3) <span style="font-family:宋体">向</span><span style="font-family:Calibri">Message</span><span style="font-family:宋体">对象中添加要携带的数据</span></span></p>
<p><span style="font-size:14px"><strong><span id="transmark"></span>可选的添加数据的方式:</strong></span></p>
<p><span style="font-size:14px">(1) msg.obj = Object(<span style="font-family:宋体">任意类型的对象</span><span style="font-family:Calibri">) </span><span style="font-family:宋体">给</span><span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">obj</span><span style="font-family:宋体">属性赋值</span></span></p>
<p><span style="font-size:14px">(2) 通过<span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">arg1</span><span style="font-family:宋体">和</span><span style="font-family:Calibri">arg2</span><span style="font-family:宋体">属性携带数据,添加数据的方式与</span><span style="font-family:Calibri">obj</span><span style="font-family:宋体">属性相同</span>msg.<span style="font-family:宋体">属性名 </span><span style="font-family:Calibri">= </span><span style="font-family:宋体">赋值;</span></span></p>
<p><span style="font-size:14px"> 此两条属性只能携带<span style="font-family:Calibri">int</span><span style="font-family:宋体">类型的数据</span></span></p>
<p><span style="font-size:14px">(3) 通过<span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">setData(Bundle args)</span><span style="font-family:宋体">方法携带数据</span></span></p>
<p><span style="font-size:14px"><strong>对应的取出数据的方式:</strong></span></p>
<p><span style="font-size:14px">在<span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">方法中,通过参数</span><span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象</span></span></p>
<p><span style="font-size:14px">(1) Object o = msg.obj; <span style="font-family:宋体">取出</span><span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">obj</span><span style="font-family:宋体">属性的值</span></span></p>
<p><span style="font-size:14px">注:接收该属性的对象可以按需求写成任意类型</span></p>
<p><span style="font-size:14px">如,接收的是一个<span style="font-family:Calibri">Bitmap</span><span style="font-family:宋体">图片数据</span></span></p>
<p><span style="font-size:14px">则可:<span style="font-family:Calibri">Bitmap o= </span><span style="font-family:宋体">(</span><span style="font-family:Calibri">Bitmap</span><span style="font-family:宋体">)</span><span style="font-family:Calibri">msg.obj;</span></span></p>
<p><span style="font-size:14px">(2) 通过<span style="font-family:Calibri">msg.arg1</span><span style="font-family:宋体">进行取值即可</span></span></p>
<p><span style="font-size:14px">(3) 通过<span style="font-family:Calibri">msg.getData </span><span style="font-family:宋体">先取出传递过来的</span><span style="font-family:Calibri">Bundle</span><span style="font-family:宋体">对象,然后通过</span><span style="font-family:Calibri">Bundle</span>对象调用<span style="font-family:Calibri">get</span><span style="font-family:宋体">方法根据</span><span style="font-family:Calibri">key</span><span style="font-family:宋体">取出对应的</span></span><span style="font-family:Calibri"><span style="font-size:14px">value</span></span></p>
<p><span style="font-size:14px"><strong>应该在什么情况下选择哪种方式携带数据?</strong></span></p>
<p><span style="font-size:14px">1. 如果要携带的数据的类型和个数不超出<span style="font-family:Calibri">2</span><span style="font-family:宋体">个</span><span style="font-family:Calibri">int</span><span style="font-family:宋体">和</span><span style="font-family:Calibri">1</span><span style="font-family:宋体">个任意类型时,推荐直接使用对应的属性进行携带</span></span></p>
<p><span style="font-size:14px">2. 如果要携带的数据的类型或者个数超出上述的限制,那么使用<span style="font-family:Calibri">setData</span><span style="font-family:宋体">方法进行携带</span></span></p>
<p><span style="font-size:14px">3. 在<span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">中接收通过</span><span style="font-family:Calibri">sendEmptyMessage</span><span style="font-family:宋体">或者通过</span><span style="font-family:Calibri">sendMessage</span><span style="font-family:宋体">方法发送过来的消息</span></span></p>
<p><span style="font-size:14px">4. 通过<span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">方法中的参数</span><span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象获取</span><span style="font-family:Calibri">msg.what</span></span><span style="font-family:宋体"><span style="font-size:14px">属性的值即可区分当前接收的是哪一个发送过来的消息</span></span></p>
<p><strong><span style="font-size:18px">使用<span style="font-family:Calibri">Handler</span></span></strong><span style="font-family:宋体"><strong><span style="font-size:18px">时的注意事项:</span></strong></span></p>
<p><span style="font-size:14px">1. handleMessage<span style="font-family:宋体">名称不要写错,参数列数不要修改</span></span></p>
<p><span style="font-size:14px">2. 在初始化<span style="font-family:Calibri">Handler</span><span style="font-family:宋体">对象,重写</span><span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">方法的时候,注意不要写成以下格式:</span></span></p>
<p><span style="font-size:14px">3. 在一个<span style="font-family:Calibri">Activity</span><span style="font-family:宋体">中支持创建多个</span><span style="font-family:Calibri">Handler</span><span style="font-family:宋体">对象,当发送消息后,由哪个</span><span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">方法进行消息的处理,取决于发送消息的对象是哪个</span><span style="font-family:Calibri">------</span><span style="font-family:宋体">哪个</span><span style="font-family:Calibri">handler</span><span style="font-family:宋体">对象发送的消息,就有哪个</span><span style="font-family:Calibri">handler</span><span style="font-family:宋体">对象进行消息的处理</span></span></p>
<p><span style="font-size:14px">4. handler<span style="font-family:宋体">对象的发送消息方法并不会阻塞主线程的运行,即</span>如果在发送消息的代码后方有其他代码,那么不会等到消息处理完后再后续代码,而是直接运行后续代码</span></p>
<link rel="stylesheet" href="http://static.blog.csdn.net/public/res-min/markdown_views.css?v=2.0">
</div>
</article>
<div class="readall_box csdn-tracking-statistics readall_box_nobg" data-mod="popu_376" style="display: none;">
<a class="btn btn-large btn-gray-fred read_more_btn" target="_self">阅读全文</a>
</div>
<div class="article_copyright">
版权声明:本文为博主原创文章,未经博主允许不得转载。
<span class="r_ico"><i class="icon iconfont icon-jubao"></i><span class="txt" id="reportBtn">举报</span></span>
</div>
<!-- <div class="reward_box">
<div class="tit">
<button class="btn_reward"><i class="icon iconfont icon-dashang-"></i></button>
</div>
<dl class="clearfix">
<dt><a href="#" target="_blank">近期打赏</a></dt>
<dd><a href="#" target="_blank"><img src="http://avatar.csdn.net/9/3/2/2_nzf_001.jpg" alt="聂兆芳" title="聂兆芳"></a></dd>
<dd><a href="#" target="_blank"><img src="http://avatar.csdn.net/9/3/2/2_nzf_001.jpg" alt="聂兆芳" title="聂兆芳"></a></dd>
<dd><a href="#" target="_blank"><img src="http://avatar.csdn.net/9/3/2/2_nzf_001.jpg" alt="聂兆芳" title="聂兆芳"></a></dd>
<dd><a href="#" target="_blank"><img src="http://avatar.csdn.net/9/3/2/2_nzf_001.jpg" alt="聂兆芳" title="聂兆芳"></a></dd>
<dd><a href="#" target="_blank"><img src="http://avatar.csdn.net/9/3/2/2_nzf_001.jpg" alt="聂兆芳" title="聂兆芳"></a></dd>
</dl>
</div>-->
<ul class="article_tags clearfix csdn-tracking-statistics" data-mod="popu_377">
<li class="tit">标签:</li>
<li><a href="http://so.csdn.net/so/search/s.do?q=androispan idtransma&t=blog" target="_blank">androispan idtransma</a> <span>/</span></li>
<li><a href="http://so.csdn.net/so/search/s.do?q=androidspan idtransm&t=blog" target="_blank">androidspan idtransm</a> <span>/</span></li>
<li><a href="http://so.csdn.net/so/search/s.do?q=Handle机span idtransm&t=blog" target="_blank">Handle机span idtransm</a> <span>/</span></li>
</ul>
<ul class="article_collect clearfix csdn-tracking-statistics" data-mod="popu_378" style="display: none;">
<li class="tit">本文已收录于以下专栏:</li>
</ul>
<div class="comment_box clearfix">
<div id="comment_form">
<div id="commentsbmitarear">
<!-- <h6><span>0</span>条评论</h6> -->
<!-- <dl class="clearfix" id="commentbox">
<dt>
<a href="http://my.csdn.net/lybcosplay"><img src="http://avatar.csdn.net/B/E/7/1_lybcosplay.jpg" ></a>
</dt>
<dd>
<a href="http://my.csdn.net/lybcosplay" target="_blank">lybcosplay</a>
</dd>
<dd class="txt_tip"><span id="tip_comment" class="tip"></span></dd>
</dl> -->
<div class="comment_area clearfix" style="height: 82px;">
<div class="userimg"><a href="http://my.csdn.net/lybcosplay"><img src="http://avatar.csdn.net/B/E/7/1_lybcosplay.jpg"></a></div>
<form action="/u013010578/comment/submit?id=50760212" method="post" οnsubmit="return subform(this);" id="commentform">
<textarea class="comment_content" name="comment_content" id="comment_content" placeholder="发表你的评论" style="height: 40px;"></textarea>
<div class="bot_bar clearfix" style="opacity: 0;">
<div id="ubbtools" class="add_code">
<a href="#insertcode" code="code" target="_self"><i class="icon iconfont icon-daima"></i></a>
</div>
<input type="hidden" id="comment_replyId" name="comment_replyId">
<input type="hidden" id="comment_userId" name="comment_userId" value="">
<input type="hidden" id="commentId" name="commentId" value="">
<input type="submit" class="btn btn-redborder" value="发表评论">
<span id="tip_comment" class="tip">
<div style="display: none;" class="csdn-tracking-statistics" data-mod="popu_384"><a href="#" target="_blank" class="comment_area_btn">发表评论</a></div>
<div id="lang_list" code="code">
<a href="#html" style="width:95px;" class="long_name" target="_self">HTML/XML</a>
<a href="#objc" style="width:95px;" class="long_name" target="_self">objective-c</a>
<a href="#delphi" style="width:58px;" class="zhong_name" target="_self">Delphi</a>
<a href="#ruby" class="zhong_name" target="_self">Ruby</a>
<a href="#php" target="_self">PHP</a>
<a href="#csharp" class="duan_name" target="_self">C#</a>
<a style=" border-right: none;" href="#cpp" class="duan_name" target="_self">C++</a>
<a style=" border-bottom:none;width:95px;" href="#javascript" class="long_name" target="_self">JavaScript</a>
<a style=" border-bottom:none;width:95px;" href="#vb" class="long_name" target="_self">Visual Basic</a>
<a style=" border-bottom:none;" href="#python" class="zhong_name" target="_self">Python</a>
<a style=" border-bottom:none;" href="#java" class="zhong_name" target="_self">Java</a>
<a style="border-bottom:none;" href="#css" class="duan_name" target="_self">CSS</a>
<a style="border-bottom:none;" href="#sql" class="duan_name" target="_self">SQL</a>
<a style="border:none; " href="#plain" class="duan_name" target="_self">其它</a>
<span class="arrb"></span>
</div>
</span></div>
</form>
</div>
</div>
</div>
</div>
<div class="comment_li_outbox"><div style="display:none"><br> 暂无评论<br><br><div class="clear"></div></div></div>
<div class="more_comment" style="display: none;">
<div id="comment_bar" class="trackgin-ad" data-mod="popu_385"></div>
</div>
<h3 class="recommend_tit">相关文章推荐</h3>
<div class="recommend_list clearfix">
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/bruce_wang_janet/article/details/41778871" target="_blank" strategy="BlogCommendFromBaidu_0">android handle 用法</a></h2>
<div class="summary">
方法一:(java习惯,在android平台开发时这样是不行的,因为它违背了单线程模型)
刚刚开始接触android线程编程的时候,习惯好像java一样,试图用下面的代码解决问题
new...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/bruce_wang_janet" target="_blank" strategy="BlogCommendFromBaidu_0"><img src="http://avatar.csdn.net/1/B/4/2_bruce_wang_janet.jpg" alt="bruce_wang_janet" title="bruce_wang_janet"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/bruce_wang_janet" target="_blank">bruce_wang_janet</a></li>
<li class="time">2014-12-06 21:15</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>3865</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/u013010578/article/details/50760212" target="_blank" strategy="BlogCommendFromCsdn_1">Android中关于Handle的用法和分析</a></h2>
<div class="summary">
Handler
1.作用:
(1). 结合Thread实现连网读取数据,读取数据后更新页面,即从子线程给主线程提供一个消息报告的作用
因此主线程中一旦接收到此消息报告,即可更新页面。
(2)....
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/u013010578" target="_blank" strategy="BlogCommendFromCsdn_1"><img src="http://avatar.csdn.net/E/B/5/2_u013010578.jpg" alt="u013010578" title="u013010578"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/u013010578" target="_blank">u013010578</a></li>
<li class="time">2016-02-28 15:40</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>586</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_393">
<dt><a href="http://edu.csdn.net/huiyiCourse/series_detail/61?utm_source=blog10" target="_blank"><img class="maxwidth" src="https://img-blog.csdn.net/20170913101427008" alt="" title=""></a></dt>
<dd>
<div class="summary">
<h2><a href="http://edu.csdn.net/huiyiCourse/series_detail/61?utm_source=blog10" target="_blank">如何成为一名机器学习的大咖?</a></h2> <div class="summary">对于机器学习,很多人的观点是:机器学习技术是今后所有技术人员都绕不过的一个门槛。 那么,普通程序员该学习机器学作为一名对机器学习心有向往的程序员,我该以什么样的姿势开始呢?</div>
</div>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/xiang_pao/article/details/20949199" target="_blank" strategy="BlogCommendFromCsdn_2">关于Android Handle的用法</a></h2>
<div class="summary">
一、Handler的定义:
主要接受子线程发送的数据,
并用此数据配合主线程更新UI.
解释: 当应用程序启动时,Android首先会开启一个主线程
(也就是UI线...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/xiang_pao" target="_blank" strategy="BlogCommendFromCsdn_2"><img src="http://avatar.csdn.net/C/4/B/2_xiang_pao.jpg" alt="xiang_pao" title="xiang_pao"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/xiang_pao" target="_blank">xiang_pao</a></li>
<li class="time">2014-03-10 20:38</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>252</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/s2311307/article/details/76769468" target="_blank" strategy="BlogCommendFromCsdn_3">分析Android中Handle机制</a></h2>
<div class="summary">
上次浅分析了android中的绘画机制,今天我们来谈谈,android中的Handle机制。在一开始学习Android的时候,总会遇见一个问题,更新UI只能在主线程中进行,而有时候做耗时操作(耗时操作...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/s2311307" target="_blank" strategy="BlogCommendFromCsdn_3"><img src="http://avatar.csdn.net/9/F/3/2_s2311307.jpg" alt="s2311307" title="s2311307"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/s2311307" target="_blank">s2311307</a></li>
<li class="time">2017-08-06 14:59</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>35</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/sinat_32869075/article/details/50826220" target="_blank" strategy="BlogCommendFromCsdn_4">android中Handle类的用法</a></h2>
<div class="summary">
当我们在处理下载或是其他需要长时间执行的任务时,如果直接把处理函数放Activity的OnCreate或是OnStart中,会导致执行过程中整个Activity无响应,如果时间过长,程序还会挂掉。Ha...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/sinat_32869075" target="_blank" strategy="BlogCommendFromCsdn_4"><img src="http://avatar.csdn.net/4/6/6/2_sinat_32869075.jpg" alt="sinat_32869075" title="sinat_32869075"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/sinat_32869075" target="_blank">sinat_32869075</a></li>
<li class="time">2016-03-08 12:32</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>207</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/dai_jing/article/details/8892452" target="_blank" strategy="BlogCommendFromCsdn_5">关于c++static关键字和extern关键字</a></h2>
<div class="summary">
1.static用于变量
当我们将变量声明为static类型,如:static int n=0,这就告诉编译器记住第一次的声明,以后再重复使用时不再声明,相当于在文件内定义一个全局变量下面给出一个例...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/dai_jing" target="_blank" strategy="BlogCommendFromCsdn_5"><img src="http://avatar.csdn.net/B/5/A/2_dai_jing.jpg" alt="dai_jing" title="dai_jing"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/dai_jing" target="_blank">dai_jing</a></li>
<li class="time">2013-05-06 21:42</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>578</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/ydx115600497/article/details/50994434" target="_blank" strategy="BlogCommendFromCsdn_6">Android中handle用法总结</a></h2>
<div class="summary">
一、Handle 的定义
Handler主要接收子线程发送的数据, 并用此数据配合主线程更新UI,用来跟UI主线程交互用。比如可以用handler发送一个message,然后...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/ydx115600497" target="_blank" strategy="BlogCommendFromCsdn_6"><img src="http://avatar.csdn.net/8/1/0/2_ydx115600497.jpg" alt="ydx115600497" title="ydx115600497"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/ydx115600497" target="_blank">ydx115600497</a></li>
<li class="time">2016-03-27 22:22</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>552</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/qq_33777090/article/details/51365373" target="_blank" strategy="BlogCommendFromCsdn_7">关于NSRunLoop和NSTimer的深入理解</a></h2>
<div class="summary">
关于NSRunLoop和NSTimer的深入理解
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/qq_33777090" target="_blank" strategy="BlogCommendFromCsdn_7"><img src="http://avatar.csdn.net/3/B/0/2_qq_33777090.jpg" alt="qq_33777090" title="qq_33777090"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/qq_33777090" target="_blank">qq_33777090</a></li>
<li class="time">2016-05-10 18:06</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>120</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/u013868143/article/details/54288247" target="_blank" strategy="BlogCommendFromCsdn_8">Android开发 -- 关于RecylerView的使用和RecylerViewAdapter的实现及监听</a></h2>
<div class="summary">
在学习Android基础的时候,碰到过listView,那么在进阶的时候,发现RecyclerView控件。
在现在的主流APP有许多在使用着RecyclerView,所以今天我们来看看Recyle...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/u013868143" target="_blank" strategy="BlogCommendFromCsdn_8"><img src="http://avatar.csdn.net/F/D/6/2_u013868143.jpg" alt="u013868143" title="u013868143"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/u013868143" target="_blank">u013868143</a></li>
<li class="time">2017-01-09 13:53</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>82</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/zyttae/article/details/44926393" target="_blank" strategy="BlogCommendFromCsdn_9">关于MFC中的#ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #endif</a></h2>
<div class="summary">
情况1:
#ifdef _DEBUG
virtual void AssertValid() const; //assert(断言)valid(有效的,正确的)
virtual void Dump...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/ZYTTAE" target="_blank" strategy="BlogCommendFromCsdn_9"><img src="http://avatar.csdn.net/3/C/6/2_zyttae.jpg" alt="ZYTTAE" title="ZYTTAE"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/ZYTTAE" target="_blank">ZYTTAE</a></li>
<li class="time">2015-04-07 21:49</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>682</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/renyuanrenyuan/article/details/7671507" target="_blank" strategy="BlogCommendFromCsdn_10">android 中的handle</a></h2>
<div class="summary">
http://www.cnblogs.com/GodBlessMe/archive/2011/04/16/2017840.html
android学习笔记之消息机制
有...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/renyuanrenyuan" target="_blank" strategy="BlogCommendFromCsdn_10"><img src="http://avatar.csdn.net/0/A/D/2_renyuanrenyuan.jpg" alt="renyuanrenyuan" title="renyuanrenyuan"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/renyuanrenyuan">renyuanrenyuan</a></li>
<li class="time">2012-06-17 19:48</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>66</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/u010550007/article/details/46364215" target="_blank" strategy="BlogCommendFromCsdn_11">Android中Handle的作用</a></h2>
<div class="summary">
今天遇到一篇写的浅显易懂的文章,特别贴出来。
在Android的UI开发中,我们经常会使用Handler来控制主UI程序的界面变化。有关Handler的作用,我们总结为:与其他线程协同工作,接收...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/u010550007" target="_blank" strategy="BlogCommendFromCsdn_11"><img src="http://avatar.csdn.net/6/E/8/2_u010550007.jpg" alt="u010550007" title="u010550007"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/u010550007">u010550007</a></li>
<li class="time">2015-06-04 16:58</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>375</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/li_huifeng/article/details/8280792" target="_blank" strategy="BlogCommendFromCsdn_12">Objective-C 关于 self 的用法总结</a></h2>
<div class="summary">
原文来自:OSChina
今天新同事问了一些关于什么时候用全局变量,什么时候用self.赋值的问题,所以笔者在此说明一下。
何时使用self.在网上搜索或者论坛里的回复大多都是简简单单的说...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/Li_Huifeng" target="_blank" strategy="BlogCommendFromCsdn_12"><img src="http://avatar.csdn.net/F/8/B/2_li_huifeng.jpg" alt="Li_Huifeng" title="Li_Huifeng"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/Li_Huifeng">Li_Huifeng</a></li>
<li class="time">2012-12-11 09:08</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>1049</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/chris_leeyc/article/details/41787297" target="_blank" strategy="BlogCommendFromCsdn_13">关于RAM的一点小见解</a></h2>
<div class="summary">
众所周知,存储器主要分为只读存储器(ROM)、闪存(flash)、随机存储器(RAM)、光磁介质存储器。
而对于随机存储器(Random-Access Memory),即我们平时所说的RAM,他和只...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/chris_leeYC" target="_blank" strategy="BlogCommendFromCsdn_13"><img src="http://avatar.csdn.net/2/0/8/2_chris_leeyc.jpg" alt="chris_leeYC" title="chris_leeYC"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/chris_leeYC">chris_leeYC</a></li>
<li class="time">2014-12-07 14:17</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>310</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/lif1234567890/article/details/54142663" target="_blank" strategy="BlogCommendFromCsdn_14">关于__vectorcall的使用</a></h2>
<div class="summary">
关于__vectorcall的使用
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/lif12345" target="_blank" strategy="BlogCommendFromCsdn_14"><img src="http://avatar.csdn.net/E/0/7/2_lif12345.jpg" alt="lif12345" title="lif12345"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/lif12345">lif12345</a></li>
<li class="time">2017-01-06 21:27</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>304</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/lihuacui/article/details/52673398" target="_blank" strategy="BlogCommendFromCsdn_15">关于C++中的句柄(handle)</a></h2>
<div class="summary">
(来自:http://blog.163.com/shaochx@126/blog/static/202195182009111101932975/)
1.句柄是什么?
在windows...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/lihuacui" target="_blank" strategy="BlogCommendFromCsdn_15"><img src="http://avatar.csdn.net/2/E/9/2_lihuacui.jpg" alt="lihuacui" title="lihuacui"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/lihuacui">lihuacui</a></li>
<li class="time">2016-09-26 20:01</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>69</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/tianxiangshan/article/details/7807230" target="_blank" strategy="BlogCommendFromCsdn_16">handle的用法</a></h2>
<div class="summary">
Handler是Android消息模型最重要的一个概念,它可以说是Android消息模型的核心,对于Looper、MessageQueue、Message 等概念一般在应用中很少使用。在Android...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/tianxiangshan" target="_blank" strategy="BlogCommendFromCsdn_16"><img src="http://avatar.csdn.net/2/3/1/2_tianxiangshan.jpg" alt="tianxiangshan" title="tianxiangshan"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/tianxiangshan">tianxiangshan</a></li>
<li class="time">2012-07-31 13:16</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>1808</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/jolin678/article/details/50010989" target="_blank" strategy="BlogCommendFromCsdn_17">关于WM_NOTIFY的使用方法</a></h2>
<div class="summary">
关于WM_NOTIFY的使用方法
切记:此消息只发给它的父窗口,再要发给父窗口的父窗口或主框架窗口等...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/jolin678" target="_blank" strategy="BlogCommendFromCsdn_17"><img src="http://avatar.csdn.net/A/E/9/2_jolin678.jpg" alt="jolin678" title="jolin678"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/jolin678">jolin678</a></li>
<li class="time">2015-11-24 12:28</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>180</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/qq_28739633/article/details/46360489" target="_blank" strategy="BlogCommendFromCsdn_18">文章标题</a></h2>
<div class="summary">
关于用研方法的心得 现实工作中用户的需求会千奇百怪,再加上数据采集,业务部门的反馈,尝尝会让很多产品经理迷失在自己的世界里,而产品不可能大而全的满足所有用户的所有需求,这点虽然是老生常谈,但仍屡见不...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/qq_28739633" target="_blank" strategy="BlogCommendFromCsdn_18"><img src="http://avatar.csdn.net/4/2/F/2_qq_28739633.jpg" alt="qq_28739633" title="qq_28739633"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/qq_28739633">qq_28739633</a></li>
<li class="time">2015-06-04 14:09</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>115</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/irelandken/article/details/6927249" target="_blank" strategy="BlogCommendFromCsdn_19">关于JSP里JavaBean的用法分析</a></h2>
<div class="summary">
关于JSP里JavaBean的用法分析:我们可以使用Scriptlet的方式: /
还可以用的方式//bean.HelloBean.java:
package bean;
public cl...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/irelandken" target="_blank" strategy="BlogCommendFromCsdn_19"><img src="http://avatar.csdn.net/F/C/E/2_irelandken.jpg" alt="irelandken" title="irelandken"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/irelandken">irelandken</a></li>
<li class="time">2011-11-02 09:49</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>2176</span></li>
</ul>
</dd>
</dl>
</div>
</main>
<aside>
<div class="right_box user_info">
<dl class="inf_bar clearfix">
<dt class="csdn-tracking-statistics" data-mod="popu_381">
<a href="http://blog.csdn.net/u013010578" target="_blank">
<img src="http://avatar.csdn.net/E/B/5/1_u013010578.jpg" class="avatar_pic">
</a>
<span class="medals" title="">
<svg class="icon" aria-hidden="true">
</svg>
</span>
</dt>
<dd>
<h3 class="csdn-tracking-statistics" data-mod="popu_380"><a href="http://blog.csdn.net/u013010578" target="_blank" id="uid">张慧彪</a></h3>
<span class="csdn-tracking-statistics" data-mod="popu_379"><a class="btn btn-redborder-small " id="span_add_follow" target="_self">+关注</a></span>
</dd>
</dl>
<div class="inf_number_box clearfix">
<dl>
<dt>原创</dt>
<dd>15</dd>
</dl>
<dl>
<dt>粉丝</dt>
<dd>0</dd>
</dl>
<dl>
<dt>喜欢</dt>
<dd>0</dd>
</dl>
<dl>
<dt>码云</dt>
<dd><a href="https://gitee.com/fsrc_648?utm_source=csdn_blog" target="_blank">0</a></dd>
</dl>
</div>
<div class="writings">
<div class="public_signal clearfix">
<h3>他的最新文章</h3>
<a href="http://blog.csdn.net/u013010578" target="_blank" class="more"><span>更多文章</span></a>
</div>
<ul class="inf_list clearfix csdn-tracking-statistics" data-mod="popu_382">
<li class="clearfix">
<a href="/u013010578/article/details/50760085" target="_blank">有关Loader加载器的使用方法和总结</a>
</li>
<li class="clearfix">
<a href="/u013010578/article/details/50628363" target="_blank">对安卓中Handle机制的一些见解</a>
</li>
<li class="clearfix">
<a href="/u013010578/article/details/50626048" target="_blank">java中线程与进程的一些总结</a>
</li>
</ul>
</div>
</div>
<div class="extension_other csdn-tracking-statistics" data-mod="popu_389">
<!--u3032528-->
<div class="flashrecommend">
<div id="_bg70lht576g06bt9" style=""><div style="cursor:auto;"><div id="oiqsfbclwy" class="mwxhbdcwmem" style="display:none;"></div><iframe width="300" frameborder="0" height="250" scrolling="no" src="http://mpb2.iteye.com/swumv?czd=472&rdy=522&yd=w525474A&gop=jvvrb5Cb4Hb4Hdnqib.eufpb.pgvb4Hw23523279Ab4Hctvkengb4Hfgvcknub4H72982434&yx=4&zskn=333223&yvd=3&vmd=4&ydn=2&vio=3&okm=372785A527296&yoh=JVON.RQUV"></iframe></div></div><script type="text/javascript" src="http://mpb1.iteye.com/bwocoltlyzdec.js"></script>
</div>
</div>
<div class="new_column right_box" style="display:none">
<h3 class="tit recommend_btn"><span><em>编辑推荐</em></span></h3>
<h3 class="tit new_btn"><span><em>最热专栏</em></span></h3>
<ul class="csdn-tracking-statistics new" data-mod="popu_434">
<li><a href="http://blog.csdn.net/column/details/16138.html" target="_blank">史上最简单的 MySQL 教程</a></li>
<li><a href="http://blog.csdn.net/column/details/13761.html" target="_blank">区块链开发技术分享</a></li>
<li><a href="http://blog.csdn.net/column/details/14531.html" target="_blank">死磕Java</a></li>
<li><a href="http://blog.csdn.net/column/details/16036.html" target="_blank">ARKit开发</a></li>
<li><a href="http://blog.csdn.net/column/details/15938.html" target="_blank">从高考到程序员</a></li>
</ul>
<ul class="recommend csdn-tracking-statistics " data-mod="popu_434">
<li><a href="#" target="_blank">编辑推荐编辑推荐编辑推荐编辑推荐编辑推荐</a></li>
</ul>
</div>
<div class="fixRight" style="position: fixed; top: 0px; left: 956.5px;">
<div class="right_box padb0 csdn-tracking-statistics" data-mod="popu_391">
<h3 class="tit"><span><em>在线课程</em></span></h3>
<ul class="edu_li clearfix">
<li>
<div>
<a href="http://edu.csdn.net/huiyiCourse/series_detail/61?utm_soruce=blog9" target="_blank">
<img src="http://img.bss.csdn.net/201709151721463908.png" alt="30天系统掌握机器学习" title="30天系统掌握机器学习">
</a>
</div>
<div>
<p><a href="http://edu.csdn.net/huiyiCourse/series_detail/61?utm_soruce=blog9" target="_blank">30天系统掌握机器学习</a></p>
<p>讲师:唐宇迪</p>
</div>
</li>
<li>
<div>
<a href="http://edu.csdn.net/huiyiCourse/detail/564?utm_source=blog9" target="_blank">
<img src="http://img.bss.csdn.net/201709151720108254.jpg" alt="【免费】XGBoost模型原理及其表现" title="【免费】XGBoost模型原理及其表现">
</a>
</div>
<div>
<p><a href="http://edu.csdn.net/huiyiCourse/detail/564?utm_source=blog9" target="_blank">【免费】XGBoost模型原理及其表现</a></p>
<p>讲师:卿来云</p>
</div>
</li>
</ul>
</div>
<!--u3032529-->
<!-- <div class="extension_other csdn-tracking-statistics baidu_box" data-mod="popu_395">
<script type="text/javascript" src="http://mpb1.iteye.com/cxpdpmumfaedgm.js"></script>
</div> -->
<div class="extension_other csdn-tracking-statistics bottomRcom" data-mod="popu_389" style="position:relative;z-index:-5;opacity:0;pointer-events:none">
<!--u3032528-->
<div class="flashrecommend">
<div style=""><iframe width="300" frameborder="0" height="250" scrolling="no" src="//mpb2.iteye.com/jyvir?czd=472&rdy=522&yd=w525474A&gop=jvvrb5Cb4Hb4Hdnqib.eufpb.pgvb4Hw23523279Ab4Hctvkengb4Hfgvcknub4H72982434&ydn=2&yx=4&vmd=4&yoh=JVON.RQUV&okm=372785A527296&yvd=4&vio=3&zskn=333223&11=v3me6lmcxr&a8=ybcvcuwhfr&l7=mfbkvuz0k9"></iframe></div><script type="text/javascript" src="http://mpb1.iteye.com/bwocoltlyzdec.js"></script>
</div>
</div>
</div>
</aside>
</div>
<div class="container clearfix">
<main>
<article>
<h1 class="csdn_top">Android中关于Handle的用法和分析</h1>
<div class="article_bar clearfix">
<div class="artical_tag">
<span class="original">原创</span>
<span class="time">2016年02月28日 15:40:50</span>
</div>
<ul class="right_bar">
<li><button class="btn-noborder"><i class="icon iconfont icon-read"></i><span class="txt">586</span></button></li>
<li><button class="btn-noborder but-comment-topicon"><i class="icon iconfont icon-pinglun"></i><span class="txt">0</span></button></li>
<li><button class="btn-noborder btn-like"><i class="icon iconfont icon-xihuan-"></i><span class="txt">1</span></button></li>
<!--<li><button class="btn-noborder"><i class="icon iconfont icon-dashang-"></i><span class="txt">0</span></button></li>-->
<li class="edit" style="display: none;">
<a class="btn-noborder" href="http://write.blog.csdn.net/postedit/50760212">
<i class="icon iconfont icon-bianji"></i><span class="txt">编辑</span>
</a>
</li>
<li class="del" style="display: none;">
<a class="btn-noborder" οnclick="javascript:deleteArticle(fileName);return false;">
<i class="icon iconfont icon-shanchu"></i><span class="txt">删除</span>
</a>
</li>
</ul>
</div>
<div id="article_content" class="article_content csdn-tracking-statistics" data-mod="popu_307" data-dsm="post" style="overflow: hidden;">
<p><span style="font-size:24px">Handler</span></p>
<p><span style="font-size:18px"><strong><span style="font-size:24px">1.作用:</span></strong></span></p>
<p><span style="font-size:18px">(1). 结合<span style="font-family:Calibri">Thread</span><span style="font-family:宋体">实现连网读取数据,读取数据后更新页面,即<span style="font-family:宋体">从子线程给主线程提供一个消息报告的作用</span></span></span></p>
<p>因此主线程中一旦接收到此消息报告,即可更新页面。</p>
<p><span style="font-size:18px">(2). 指定一系列的动作排队执行</span></p>
<p><strong><span style="font-size:18px"><span style="font-size:24px">2.实现步骤:</span></span></strong></p>
<p><span style="font-size:18px">1. 创建<span style="font-family:Calibri">Handler</span></span><span style="font-family:宋体"><span style="font-size:14px"><span style="font-size:18px">对象</span></span></span></p>
<p><span style="font-size:14px; color:#FF0000">注:在<span style="font-family:Calibri">new</span><span style="font-family:宋体">对象的结尾添加</span><span style="font-family:Calibri">{}</span><span style="font-family:宋体">,并重写</span><span style="font-family:Calibri">handleMessage</span></span><span style="font-family:宋体"><span style="color:#FF0000"><span style="font-size:14px">方法</span></span></span></p>
<p><span style="font-size:18px">2. 通过<span style="font-family:Calibri">handler</span></span><span style="font-family:宋体"><span style="font-size:14px"><span style="font-size:18px">发送消息</span></span></span></p>
<p><span style="font-size:14px"> 2.1在发送消息时可选择发送空消息或者非空消息</span></p>
<p><strong><span style="font-size:14px"> 非空消息与空消息的区别:</span></strong></p>
<p><span style="font-size:14px"> 空消息中只能携带一个<span style="font-family:Calibri">int</span><span style="font-family:宋体">类型的数字</span></span></p>
<p><span style="font-size:14px"> 非空消息中除了可以携带<span style="font-family:Calibri">int</span></span><span style="font-family:宋体"><span style="font-size:14px">类型的数字外,还可携带一些其他数据</span></span></p>
<p><strong><span style="font-size:14px"> 发送消息时可选择的方法:</span></strong></p>
<p><span style="font-size:14px"> a) sendEmptyMessage<span style="font-family:宋体">(</span><span style="font-family:Calibri">int what</span><span style="font-family:宋体">)发送空消息</span></span></p>
<p><span style="font-size:14px"> 参数作用:给当前发送的消息匹配一个唯一标识 由于所有通过<span style="font-family:Calibri">handler</span><span style="font-family:宋体">对象发送的消息,最后都会到同一个</span><span style="font-family:Calibri"> handleMessage</span><span style="font-family:宋体">方法中进行接收</span></span></p>
<p><span style="font-size:14px"> 因此,为了<span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">方法中区分当前接收的消息是哪一个条</span>通过<span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">what</span><span style="font-family:宋体">属性进行判断</span></span></p>
<p><span style="font-size:14px"> b) sendMessage (Message msg) </span><span style="font-family:宋体"><span style="font-size:14px">发送非空消息</span></span></p>
<p><span style="font-size:14px"> 2.2发送步骤:</span></p>
<p><span style="font-size:14px"> 1)<span style="font-family:宋体">封装要发送的</span><span style="font-family:Calibri">Message</span><span style="font-family:宋体">对象</span></span></p>
<p><span style="font-size:14px"> 初始化方式有以下<span style="font-family:Calibri">3</span><span style="font-family:宋体">种:</span></span></p>
<p><span style="font-size:14px"> Message msg = new Message();</span></p>
<p><span style="font-size:14px"> Message msg = Message.obtain();</span></p>
<p><span style="font-size:14px"> Message msg = handler.obtainMessage();</span></p>
<p><span style="font-size:14px"> 推荐选择后两种方式的任意一种进行初始化,不推荐使用<span style="font-family:Calibri">new Message</span><span style="font-family:宋体">方法获取对象</span></span></p>
<p><span style="font-size:14px">原因:后两种方式在创建对象时会去判断内存中是否有能够直接使用的<span style="font-family:Calibri">Message</span><span style="font-family:宋体">对象,如果有,直接拿来用,</span></span></p>
<p><span style="font-size:14px">如果没有,再新建对象使用。通过后两种方式可以减少创建对象的个数,在内存方面比较优化</span></p>
<p><span style="font-size:14px"> 2) <span style="font-family:宋体">通过调用</span><span style="font-family:Calibri">msg.what = n</span><span style="font-family:宋体">(任意数字)给当前封装的</span><span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">what</span><span style="font-family:宋体">属性赋值</span></span></p>
<p><span style="font-size:14px"> 3) <span style="font-family:宋体">向</span><span style="font-family:Calibri">Message</span><span style="font-family:宋体">对象中添加要携带的数据</span></span></p>
<p><span style="font-size:14px"><strong><span id="transmark"></span>可选的添加数据的方式:</strong></span></p>
<p><span style="font-size:14px">(1) msg.obj = Object(<span style="font-family:宋体">任意类型的对象</span><span style="font-family:Calibri">) </span><span style="font-family:宋体">给</span><span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">obj</span><span style="font-family:宋体">属性赋值</span></span></p>
<p><span style="font-size:14px">(2) 通过<span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">arg1</span><span style="font-family:宋体">和</span><span style="font-family:Calibri">arg2</span><span style="font-family:宋体">属性携带数据,添加数据的方式与</span><span style="font-family:Calibri">obj</span><span style="font-family:宋体">属性相同</span>msg.<span style="font-family:宋体">属性名 </span><span style="font-family:Calibri">= </span><span style="font-family:宋体">赋值;</span></span></p>
<p><span style="font-size:14px"> 此两条属性只能携带<span style="font-family:Calibri">int</span><span style="font-family:宋体">类型的数据</span></span></p>
<p><span style="font-size:14px">(3) 通过<span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">setData(Bundle args)</span><span style="font-family:宋体">方法携带数据</span></span></p>
<p><span style="font-size:14px"><strong>对应的取出数据的方式:</strong></span></p>
<p><span style="font-size:14px">在<span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">方法中,通过参数</span><span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象</span></span></p>
<p><span style="font-size:14px">(1) Object o = msg.obj; <span style="font-family:宋体">取出</span><span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象的</span><span style="font-family:Calibri">obj</span><span style="font-family:宋体">属性的值</span></span></p>
<p><span style="font-size:14px">注:接收该属性的对象可以按需求写成任意类型</span></p>
<p><span style="font-size:14px">如,接收的是一个<span style="font-family:Calibri">Bitmap</span><span style="font-family:宋体">图片数据</span></span></p>
<p><span style="font-size:14px">则可:<span style="font-family:Calibri">Bitmap o= </span><span style="font-family:宋体">(</span><span style="font-family:Calibri">Bitmap</span><span style="font-family:宋体">)</span><span style="font-family:Calibri">msg.obj;</span></span></p>
<p><span style="font-size:14px">(2) 通过<span style="font-family:Calibri">msg.arg1</span><span style="font-family:宋体">进行取值即可</span></span></p>
<p><span style="font-size:14px">(3) 通过<span style="font-family:Calibri">msg.getData </span><span style="font-family:宋体">先取出传递过来的</span><span style="font-family:Calibri">Bundle</span><span style="font-family:宋体">对象,然后通过</span><span style="font-family:Calibri">Bundle</span>对象调用<span style="font-family:Calibri">get</span><span style="font-family:宋体">方法根据</span><span style="font-family:Calibri">key</span><span style="font-family:宋体">取出对应的</span></span><span style="font-family:Calibri"><span style="font-size:14px">value</span></span></p>
<p><span style="font-size:14px"><strong>应该在什么情况下选择哪种方式携带数据?</strong></span></p>
<p><span style="font-size:14px">1. 如果要携带的数据的类型和个数不超出<span style="font-family:Calibri">2</span><span style="font-family:宋体">个</span><span style="font-family:Calibri">int</span><span style="font-family:宋体">和</span><span style="font-family:Calibri">1</span><span style="font-family:宋体">个任意类型时,推荐直接使用对应的属性进行携带</span></span></p>
<p><span style="font-size:14px">2. 如果要携带的数据的类型或者个数超出上述的限制,那么使用<span style="font-family:Calibri">setData</span><span style="font-family:宋体">方法进行携带</span></span></p>
<p><span style="font-size:14px">3. 在<span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">中接收通过</span><span style="font-family:Calibri">sendEmptyMessage</span><span style="font-family:宋体">或者通过</span><span style="font-family:Calibri">sendMessage</span><span style="font-family:宋体">方法发送过来的消息</span></span></p>
<p><span style="font-size:14px">4. 通过<span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">方法中的参数</span><span style="font-family:Calibri">msg</span><span style="font-family:宋体">对象获取</span><span style="font-family:Calibri">msg.what</span></span><span style="font-family:宋体"><span style="font-size:14px">属性的值即可区分当前接收的是哪一个发送过来的消息</span></span></p>
<p><strong><span style="font-size:18px">使用<span style="font-family:Calibri">Handler</span></span></strong><span style="font-family:宋体"><strong><span style="font-size:18px">时的注意事项:</span></strong></span></p>
<p><span style="font-size:14px">1. handleMessage<span style="font-family:宋体">名称不要写错,参数列数不要修改</span></span></p>
<p><span style="font-size:14px">2. 在初始化<span style="font-family:Calibri">Handler</span><span style="font-family:宋体">对象,重写</span><span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">方法的时候,注意不要写成以下格式:</span></span></p>
<p><span style="font-size:14px">3. 在一个<span style="font-family:Calibri">Activity</span><span style="font-family:宋体">中支持创建多个</span><span style="font-family:Calibri">Handler</span><span style="font-family:宋体">对象,当发送消息后,由哪个</span><span style="font-family:Calibri">handleMessage</span><span style="font-family:宋体">方法进行消息的处理,取决于发送消息的对象是哪个</span><span style="font-family:Calibri">------</span><span style="font-family:宋体">哪个</span><span style="font-family:Calibri">handler</span><span style="font-family:宋体">对象发送的消息,就有哪个</span><span style="font-family:Calibri">handler</span><span style="font-family:宋体">对象进行消息的处理</span></span></p>
<p><span style="font-size:14px">4. handler<span style="font-family:宋体">对象的发送消息方法并不会阻塞主线程的运行,即</span>如果在发送消息的代码后方有其他代码,那么不会等到消息处理完后再后续代码,而是直接运行后续代码</span></p>
<link rel="stylesheet" href="http://static.blog.csdn.net/public/res-min/markdown_views.css?v=2.0">
</div>
</article>
<div class="readall_box csdn-tracking-statistics readall_box_nobg" data-mod="popu_376" style="display: none;">
<a class="btn btn-large btn-gray-fred read_more_btn" target="_self">阅读全文</a>
</div>
<div class="article_copyright">
版权声明:本文为博主原创文章,未经博主允许不得转载。
<span class="r_ico"><i class="icon iconfont icon-jubao"></i><span class="txt" id="reportBtn">举报</span></span>
</div>
<!-- <div class="reward_box">
<div class="tit">
<button class="btn_reward"><i class="icon iconfont icon-dashang-"></i></button>
</div>
<dl class="clearfix">
<dt><a href="#" target="_blank">近期打赏</a></dt>
<dd><a href="#" target="_blank"><img src="http://avatar.csdn.net/9/3/2/2_nzf_001.jpg" alt="聂兆芳" title="聂兆芳"></a></dd>
<dd><a href="#" target="_blank"><img src="http://avatar.csdn.net/9/3/2/2_nzf_001.jpg" alt="聂兆芳" title="聂兆芳"></a></dd>
<dd><a href="#" target="_blank"><img src="http://avatar.csdn.net/9/3/2/2_nzf_001.jpg" alt="聂兆芳" title="聂兆芳"></a></dd>
<dd><a href="#" target="_blank"><img src="http://avatar.csdn.net/9/3/2/2_nzf_001.jpg" alt="聂兆芳" title="聂兆芳"></a></dd>
<dd><a href="#" target="_blank"><img src="http://avatar.csdn.net/9/3/2/2_nzf_001.jpg" alt="聂兆芳" title="聂兆芳"></a></dd>
</dl>
</div>-->
<ul class="article_tags clearfix csdn-tracking-statistics" data-mod="popu_377">
<li class="tit">标签:</li>
<li><a href="http://so.csdn.net/so/search/s.do?q=androispan idtransma&t=blog" target="_blank">androispan idtransma</a> <span>/</span></li>
<li><a href="http://so.csdn.net/so/search/s.do?q=androidspan idtransm&t=blog" target="_blank">androidspan idtransm</a> <span>/</span></li>
<li><a href="http://so.csdn.net/so/search/s.do?q=Handle机span idtransm&t=blog" target="_blank">Handle机span idtransm</a> <span>/</span></li>
</ul>
<ul class="article_collect clearfix csdn-tracking-statistics" data-mod="popu_378" style="display: none;">
<li class="tit">本文已收录于以下专栏:</li>
</ul>
<div class="comment_box clearfix">
<div id="comment_form">
<div id="commentsbmitarear">
<!-- <h6><span>0</span>条评论</h6> -->
<!-- <dl class="clearfix" id="commentbox">
<dt>
<a href="http://my.csdn.net/lybcosplay"><img src="http://avatar.csdn.net/B/E/7/1_lybcosplay.jpg" ></a>
</dt>
<dd>
<a href="http://my.csdn.net/lybcosplay" target="_blank">lybcosplay</a>
</dd>
<dd class="txt_tip"><span id="tip_comment" class="tip"></span></dd>
</dl> -->
<div class="comment_area clearfix" style="height: 82px;">
<div class="userimg"><a href="http://my.csdn.net/lybcosplay"><img src="http://avatar.csdn.net/B/E/7/1_lybcosplay.jpg"></a></div>
<form action="/u013010578/comment/submit?id=50760212" method="post" οnsubmit="return subform(this);" id="commentform">
<textarea class="comment_content" name="comment_content" id="comment_content" placeholder="发表你的评论" style="height: 40px;"></textarea>
<div class="bot_bar clearfix" style="opacity: 0;">
<div id="ubbtools" class="add_code">
<a href="#insertcode" code="code" target="_self"><i class="icon iconfont icon-daima"></i></a>
</div>
<input type="hidden" id="comment_replyId" name="comment_replyId">
<input type="hidden" id="comment_userId" name="comment_userId" value="">
<input type="hidden" id="commentId" name="commentId" value="">
<input type="submit" class="btn btn-redborder" value="发表评论">
<span id="tip_comment" class="tip">
<div style="display: none;" class="csdn-tracking-statistics" data-mod="popu_384"><a href="#" target="_blank" class="comment_area_btn">发表评论</a></div>
<div id="lang_list" code="code">
<a href="#html" style="width:95px;" class="long_name" target="_self">HTML/XML</a>
<a href="#objc" style="width:95px;" class="long_name" target="_self">objective-c</a>
<a href="#delphi" style="width:58px;" class="zhong_name" target="_self">Delphi</a>
<a href="#ruby" class="zhong_name" target="_self">Ruby</a>
<a href="#php" target="_self">PHP</a>
<a href="#csharp" class="duan_name" target="_self">C#</a>
<a style=" border-right: none;" href="#cpp" class="duan_name" target="_self">C++</a>
<a style=" border-bottom:none;width:95px;" href="#javascript" class="long_name" target="_self">JavaScript</a>
<a style=" border-bottom:none;width:95px;" href="#vb" class="long_name" target="_self">Visual Basic</a>
<a style=" border-bottom:none;" href="#python" class="zhong_name" target="_self">Python</a>
<a style=" border-bottom:none;" href="#java" class="zhong_name" target="_self">Java</a>
<a style="border-bottom:none;" href="#css" class="duan_name" target="_self">CSS</a>
<a style="border-bottom:none;" href="#sql" class="duan_name" target="_self">SQL</a>
<a style="border:none; " href="#plain" class="duan_name" target="_self">其它</a>
<span class="arrb"></span>
</div>
</span></div>
</form>
</div>
</div>
</div>
</div>
<div class="comment_li_outbox"><div style="display:none"><br> 暂无评论<br><br><div class="clear"></div></div></div>
<div class="more_comment" style="display: none;">
<div id="comment_bar" class="trackgin-ad" data-mod="popu_385"></div>
</div>
<h3 class="recommend_tit">相关文章推荐</h3>
<div class="recommend_list clearfix">
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/bruce_wang_janet/article/details/41778871" target="_blank" strategy="BlogCommendFromBaidu_0">android handle 用法</a></h2>
<div class="summary">
方法一:(java习惯,在android平台开发时这样是不行的,因为它违背了单线程模型)
刚刚开始接触android线程编程的时候,习惯好像java一样,试图用下面的代码解决问题
new...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/bruce_wang_janet" target="_blank" strategy="BlogCommendFromBaidu_0"><img src="http://avatar.csdn.net/1/B/4/2_bruce_wang_janet.jpg" alt="bruce_wang_janet" title="bruce_wang_janet"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/bruce_wang_janet" target="_blank">bruce_wang_janet</a></li>
<li class="time">2014-12-06 21:15</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>3865</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/u013010578/article/details/50760212" target="_blank" strategy="BlogCommendFromCsdn_1">Android中关于Handle的用法和分析</a></h2>
<div class="summary">
Handler
1.作用:
(1). 结合Thread实现连网读取数据,读取数据后更新页面,即从子线程给主线程提供一个消息报告的作用
因此主线程中一旦接收到此消息报告,即可更新页面。
(2)....
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/u013010578" target="_blank" strategy="BlogCommendFromCsdn_1"><img src="http://avatar.csdn.net/E/B/5/2_u013010578.jpg" alt="u013010578" title="u013010578"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/u013010578" target="_blank">u013010578</a></li>
<li class="time">2016-02-28 15:40</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>586</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_393">
<dt><a href="http://edu.csdn.net/huiyiCourse/series_detail/61?utm_source=blog10" target="_blank"><img class="maxwidth" src="https://img-blog.csdn.net/20170913101427008" alt="" title=""></a></dt>
<dd>
<div class="summary">
<h2><a href="http://edu.csdn.net/huiyiCourse/series_detail/61?utm_source=blog10" target="_blank">如何成为一名机器学习的大咖?</a></h2> <div class="summary">对于机器学习,很多人的观点是:机器学习技术是今后所有技术人员都绕不过的一个门槛。 那么,普通程序员该学习机器学作为一名对机器学习心有向往的程序员,我该以什么样的姿势开始呢?</div>
</div>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/xiang_pao/article/details/20949199" target="_blank" strategy="BlogCommendFromCsdn_2">关于Android Handle的用法</a></h2>
<div class="summary">
一、Handler的定义:
主要接受子线程发送的数据,
并用此数据配合主线程更新UI.
解释: 当应用程序启动时,Android首先会开启一个主线程
(也就是UI线...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/xiang_pao" target="_blank" strategy="BlogCommendFromCsdn_2"><img src="http://avatar.csdn.net/C/4/B/2_xiang_pao.jpg" alt="xiang_pao" title="xiang_pao"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/xiang_pao" target="_blank">xiang_pao</a></li>
<li class="time">2014-03-10 20:38</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>252</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/s2311307/article/details/76769468" target="_blank" strategy="BlogCommendFromCsdn_3">分析Android中Handle机制</a></h2>
<div class="summary">
上次浅分析了android中的绘画机制,今天我们来谈谈,android中的Handle机制。在一开始学习Android的时候,总会遇见一个问题,更新UI只能在主线程中进行,而有时候做耗时操作(耗时操作...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/s2311307" target="_blank" strategy="BlogCommendFromCsdn_3"><img src="http://avatar.csdn.net/9/F/3/2_s2311307.jpg" alt="s2311307" title="s2311307"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/s2311307" target="_blank">s2311307</a></li>
<li class="time">2017-08-06 14:59</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>35</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/sinat_32869075/article/details/50826220" target="_blank" strategy="BlogCommendFromCsdn_4">android中Handle类的用法</a></h2>
<div class="summary">
当我们在处理下载或是其他需要长时间执行的任务时,如果直接把处理函数放Activity的OnCreate或是OnStart中,会导致执行过程中整个Activity无响应,如果时间过长,程序还会挂掉。Ha...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/sinat_32869075" target="_blank" strategy="BlogCommendFromCsdn_4"><img src="http://avatar.csdn.net/4/6/6/2_sinat_32869075.jpg" alt="sinat_32869075" title="sinat_32869075"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/sinat_32869075" target="_blank">sinat_32869075</a></li>
<li class="time">2016-03-08 12:32</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>207</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/dai_jing/article/details/8892452" target="_blank" strategy="BlogCommendFromCsdn_5">关于c++static关键字和extern关键字</a></h2>
<div class="summary">
1.static用于变量
当我们将变量声明为static类型,如:static int n=0,这就告诉编译器记住第一次的声明,以后再重复使用时不再声明,相当于在文件内定义一个全局变量下面给出一个例...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/dai_jing" target="_blank" strategy="BlogCommendFromCsdn_5"><img src="http://avatar.csdn.net/B/5/A/2_dai_jing.jpg" alt="dai_jing" title="dai_jing"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/dai_jing" target="_blank">dai_jing</a></li>
<li class="time">2013-05-06 21:42</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>578</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/ydx115600497/article/details/50994434" target="_blank" strategy="BlogCommendFromCsdn_6">Android中handle用法总结</a></h2>
<div class="summary">
一、Handle 的定义
Handler主要接收子线程发送的数据, 并用此数据配合主线程更新UI,用来跟UI主线程交互用。比如可以用handler发送一个message,然后...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/ydx115600497" target="_blank" strategy="BlogCommendFromCsdn_6"><img src="http://avatar.csdn.net/8/1/0/2_ydx115600497.jpg" alt="ydx115600497" title="ydx115600497"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/ydx115600497" target="_blank">ydx115600497</a></li>
<li class="time">2016-03-27 22:22</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>552</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/qq_33777090/article/details/51365373" target="_blank" strategy="BlogCommendFromCsdn_7">关于NSRunLoop和NSTimer的深入理解</a></h2>
<div class="summary">
关于NSRunLoop和NSTimer的深入理解
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/qq_33777090" target="_blank" strategy="BlogCommendFromCsdn_7"><img src="http://avatar.csdn.net/3/B/0/2_qq_33777090.jpg" alt="qq_33777090" title="qq_33777090"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/qq_33777090" target="_blank">qq_33777090</a></li>
<li class="time">2016-05-10 18:06</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>120</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/u013868143/article/details/54288247" target="_blank" strategy="BlogCommendFromCsdn_8">Android开发 -- 关于RecylerView的使用和RecylerViewAdapter的实现及监听</a></h2>
<div class="summary">
在学习Android基础的时候,碰到过listView,那么在进阶的时候,发现RecyclerView控件。
在现在的主流APP有许多在使用着RecyclerView,所以今天我们来看看Recyle...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/u013868143" target="_blank" strategy="BlogCommendFromCsdn_8"><img src="http://avatar.csdn.net/F/D/6/2_u013868143.jpg" alt="u013868143" title="u013868143"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/u013868143" target="_blank">u013868143</a></li>
<li class="time">2017-01-09 13:53</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>82</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/zyttae/article/details/44926393" target="_blank" strategy="BlogCommendFromCsdn_9">关于MFC中的#ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #endif</a></h2>
<div class="summary">
情况1:
#ifdef _DEBUG
virtual void AssertValid() const; //assert(断言)valid(有效的,正确的)
virtual void Dump...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/ZYTTAE" target="_blank" strategy="BlogCommendFromCsdn_9"><img src="http://avatar.csdn.net/3/C/6/2_zyttae.jpg" alt="ZYTTAE" title="ZYTTAE"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/ZYTTAE" target="_blank">ZYTTAE</a></li>
<li class="time">2015-04-07 21:49</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>682</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/renyuanrenyuan/article/details/7671507" target="_blank" strategy="BlogCommendFromCsdn_10">android 中的handle</a></h2>
<div class="summary">
http://www.cnblogs.com/GodBlessMe/archive/2011/04/16/2017840.html
android学习笔记之消息机制
有...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/renyuanrenyuan" target="_blank" strategy="BlogCommendFromCsdn_10"><img src="http://avatar.csdn.net/0/A/D/2_renyuanrenyuan.jpg" alt="renyuanrenyuan" title="renyuanrenyuan"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/renyuanrenyuan">renyuanrenyuan</a></li>
<li class="time">2012-06-17 19:48</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>66</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/u010550007/article/details/46364215" target="_blank" strategy="BlogCommendFromCsdn_11">Android中Handle的作用</a></h2>
<div class="summary">
今天遇到一篇写的浅显易懂的文章,特别贴出来。
在Android的UI开发中,我们经常会使用Handler来控制主UI程序的界面变化。有关Handler的作用,我们总结为:与其他线程协同工作,接收...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/u010550007" target="_blank" strategy="BlogCommendFromCsdn_11"><img src="http://avatar.csdn.net/6/E/8/2_u010550007.jpg" alt="u010550007" title="u010550007"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/u010550007">u010550007</a></li>
<li class="time">2015-06-04 16:58</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>375</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/li_huifeng/article/details/8280792" target="_blank" strategy="BlogCommendFromCsdn_12">Objective-C 关于 self 的用法总结</a></h2>
<div class="summary">
原文来自:OSChina
今天新同事问了一些关于什么时候用全局变量,什么时候用self.赋值的问题,所以笔者在此说明一下。
何时使用self.在网上搜索或者论坛里的回复大多都是简简单单的说...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/Li_Huifeng" target="_blank" strategy="BlogCommendFromCsdn_12"><img src="http://avatar.csdn.net/F/8/B/2_li_huifeng.jpg" alt="Li_Huifeng" title="Li_Huifeng"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/Li_Huifeng">Li_Huifeng</a></li>
<li class="time">2012-12-11 09:08</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>1049</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/chris_leeyc/article/details/41787297" target="_blank" strategy="BlogCommendFromCsdn_13">关于RAM的一点小见解</a></h2>
<div class="summary">
众所周知,存储器主要分为只读存储器(ROM)、闪存(flash)、随机存储器(RAM)、光磁介质存储器。
而对于随机存储器(Random-Access Memory),即我们平时所说的RAM,他和只...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/chris_leeYC" target="_blank" strategy="BlogCommendFromCsdn_13"><img src="http://avatar.csdn.net/2/0/8/2_chris_leeyc.jpg" alt="chris_leeYC" title="chris_leeYC"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/chris_leeYC">chris_leeYC</a></li>
<li class="time">2014-12-07 14:17</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>310</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/lif1234567890/article/details/54142663" target="_blank" strategy="BlogCommendFromCsdn_14">关于__vectorcall的使用</a></h2>
<div class="summary">
关于__vectorcall的使用
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/lif12345" target="_blank" strategy="BlogCommendFromCsdn_14"><img src="http://avatar.csdn.net/E/0/7/2_lif12345.jpg" alt="lif12345" title="lif12345"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/lif12345">lif12345</a></li>
<li class="time">2017-01-06 21:27</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>304</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/lihuacui/article/details/52673398" target="_blank" strategy="BlogCommendFromCsdn_15">关于C++中的句柄(handle)</a></h2>
<div class="summary">
(来自:http://blog.163.com/shaochx@126/blog/static/202195182009111101932975/)
1.句柄是什么?
在windows...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/lihuacui" target="_blank" strategy="BlogCommendFromCsdn_15"><img src="http://avatar.csdn.net/2/E/9/2_lihuacui.jpg" alt="lihuacui" title="lihuacui"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/lihuacui">lihuacui</a></li>
<li class="time">2016-09-26 20:01</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>69</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/tianxiangshan/article/details/7807230" target="_blank" strategy="BlogCommendFromCsdn_16">handle的用法</a></h2>
<div class="summary">
Handler是Android消息模型最重要的一个概念,它可以说是Android消息模型的核心,对于Looper、MessageQueue、Message 等概念一般在应用中很少使用。在Android...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/tianxiangshan" target="_blank" strategy="BlogCommendFromCsdn_16"><img src="http://avatar.csdn.net/2/3/1/2_tianxiangshan.jpg" alt="tianxiangshan" title="tianxiangshan"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/tianxiangshan">tianxiangshan</a></li>
<li class="time">2012-07-31 13:16</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>1808</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/jolin678/article/details/50010989" target="_blank" strategy="BlogCommendFromCsdn_17">关于WM_NOTIFY的使用方法</a></h2>
<div class="summary">
关于WM_NOTIFY的使用方法
切记:此消息只发给它的父窗口,再要发给父窗口的父窗口或主框架窗口等...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/jolin678" target="_blank" strategy="BlogCommendFromCsdn_17"><img src="http://avatar.csdn.net/A/E/9/2_jolin678.jpg" alt="jolin678" title="jolin678"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/jolin678">jolin678</a></li>
<li class="time">2015-11-24 12:28</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>180</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/qq_28739633/article/details/46360489" target="_blank" strategy="BlogCommendFromCsdn_18">文章标题</a></h2>
<div class="summary">
关于用研方法的心得 现实工作中用户的需求会千奇百怪,再加上数据采集,业务部门的反馈,尝尝会让很多产品经理迷失在自己的世界里,而产品不可能大而全的满足所有用户的所有需求,这点虽然是老生常谈,但仍屡见不...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/qq_28739633" target="_blank" strategy="BlogCommendFromCsdn_18"><img src="http://avatar.csdn.net/4/2/F/2_qq_28739633.jpg" alt="qq_28739633" title="qq_28739633"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/qq_28739633">qq_28739633</a></li>
<li class="time">2015-06-04 14:09</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>115</span></li>
</ul>
</dd>
</dl>
<dl class="clearfix csdn-tracking-statistics" data-mod="popu_387" data-poputype="feed" data-feed-show="false" data-dsm="post">
<dd>
<h2><a href="/irelandken/article/details/6927249" target="_blank" strategy="BlogCommendFromCsdn_19">关于JSP里JavaBean的用法分析</a></h2>
<div class="summary">
关于JSP里JavaBean的用法分析:我们可以使用Scriptlet的方式: /
还可以用的方式//bean.HelloBean.java:
package bean;
public cl...
</div>
<ul>
<li class="avatar_img"><a href="http://blog.csdn.net/irelandken" target="_blank" strategy="BlogCommendFromCsdn_19"><img src="http://avatar.csdn.net/F/C/E/2_irelandken.jpg" alt="irelandken" title="irelandken"></a></li>
<li class="user_name"><a href="http://blog.csdn.net/irelandken">irelandken</a></li>
<li class="time">2011-11-02 09:49</li>
<li class="visited_num"><i class="icon iconfont icon-read"></i><span>2176</span></li>
</ul>
</dd>
</dl>
</div>
</main>
<aside>
<div class="right_box user_info">
<dl class="inf_bar clearfix">
<dt class="csdn-tracking-statistics" data-mod="popu_381">
<a href="http://blog.csdn.net/u013010578" target="_blank">
<img src="http://avatar.csdn.net/E/B/5/1_u013010578.jpg" class="avatar_pic">
</a>
<span class="medals" title="">
<svg class="icon" aria-hidden="true">
</svg>
</span>
</dt>
<dd>
<h3 class="csdn-tracking-statistics" data-mod="popu_380"><a href="http://blog.csdn.net/u013010578" target="_blank" id="uid">张慧彪</a></h3>
<span class="csdn-tracking-statistics" data-mod="popu_379"><a class="btn btn-redborder-small " id="span_add_follow" target="_self">+关注</a></span>
</dd>
</dl>
<div class="inf_number_box clearfix">
<dl>
<dt>原创</dt>
<dd>15</dd>
</dl>
<dl>
<dt>粉丝</dt>
<dd>0</dd>
</dl>
<dl>
<dt>喜欢</dt>
<dd>0</dd>
</dl>
<dl>
<dt>码云</dt>
<dd><a href="https://gitee.com/fsrc_648?utm_source=csdn_blog" target="_blank">0</a></dd>
</dl>
</div>
<div class="writings">
<div class="public_signal clearfix">
<h3>他的最新文章</h3>
<a href="http://blog.csdn.net/u013010578" target="_blank" class="more"><span>更多文章</span></a>
</div>
<ul class="inf_list clearfix csdn-tracking-statistics" data-mod="popu_382">
<li class="clearfix">
<a href="/u013010578/article/details/50760085" target="_blank">有关Loader加载器的使用方法和总结</a>
</li>
<li class="clearfix">
<a href="/u013010578/article/details/50628363" target="_blank">对安卓中Handle机制的一些见解</a>
</li>
<li class="clearfix">
<a href="/u013010578/article/details/50626048" target="_blank">java中线程与进程的一些总结</a>
</li>
</ul>
</div>
</div>
<div class="extension_other csdn-tracking-statistics" data-mod="popu_389">
<!--u3032528-->
<div class="flashrecommend">
<div id="_bg70lht576g06bt9" style=""><div style="cursor:auto;"><div id="oiqsfbclwy" class="mwxhbdcwmem" style="display:none;"></div><iframe width="300" frameborder="0" height="250" scrolling="no" src="http://mpb2.iteye.com/swumv?czd=472&rdy=522&yd=w525474A&gop=jvvrb5Cb4Hb4Hdnqib.eufpb.pgvb4Hw23523279Ab4Hctvkengb4Hfgvcknub4H72982434&yx=4&zskn=333223&yvd=3&vmd=4&ydn=2&vio=3&okm=372785A527296&yoh=JVON.RQUV"></iframe></div></div><script type="text/javascript" src="http://mpb1.iteye.com/bwocoltlyzdec.js"></script>
</div>
</div>
<div class="new_column right_box" style="display:none">
<h3 class="tit recommend_btn"><span><em>编辑推荐</em></span></h3>
<h3 class="tit new_btn"><span><em>最热专栏</em></span></h3>
<ul class="csdn-tracking-statistics new" data-mod="popu_434">
<li><a href="http://blog.csdn.net/column/details/16138.html" target="_blank">史上最简单的 MySQL 教程</a></li>
<li><a href="http://blog.csdn.net/column/details/13761.html" target="_blank">区块链开发技术分享</a></li>
<li><a href="http://blog.csdn.net/column/details/14531.html" target="_blank">死磕Java</a></li>
<li><a href="http://blog.csdn.net/column/details/16036.html" target="_blank">ARKit开发</a></li>
<li><a href="http://blog.csdn.net/column/details/15938.html" target="_blank">从高考到程序员</a></li>
</ul>
<ul class="recommend csdn-tracking-statistics " data-mod="popu_434">
<li><a href="#" target="_blank">编辑推荐编辑推荐编辑推荐编辑推荐编辑推荐</a></li>
</ul>
</div>
<div class="fixRight" style="position: fixed; top: 0px; left: 956.5px;">
<div class="right_box padb0 csdn-tracking-statistics" data-mod="popu_391">
<h3 class="tit"><span><em>在线课程</em></span></h3>
<ul class="edu_li clearfix">
<li>
<div>
<a href="http://edu.csdn.net/huiyiCourse/series_detail/61?utm_soruce=blog9" target="_blank">
<img src="http://img.bss.csdn.net/201709151721463908.png" alt="30天系统掌握机器学习" title="30天系统掌握机器学习">
</a>
</div>
<div>
<p><a href="http://edu.csdn.net/huiyiCourse/series_detail/61?utm_soruce=blog9" target="_blank">30天系统掌握机器学习</a></p>
<p>讲师:唐宇迪</p>
</div>
</li>
<li>
<div>
<a href="http://edu.csdn.net/huiyiCourse/detail/564?utm_source=blog9" target="_blank">
<img src="http://img.bss.csdn.net/201709151720108254.jpg" alt="【免费】XGBoost模型原理及其表现" title="【免费】XGBoost模型原理及其表现">
</a>
</div>
<div>
<p><a href="http://edu.csdn.net/huiyiCourse/detail/564?utm_source=blog9" target="_blank">【免费】XGBoost模型原理及其表现</a></p>
<p>讲师:卿来云</p>
</div>
</li>
</ul>
</div>
<!--u3032529-->
<!-- <div class="extension_other csdn-tracking-statistics baidu_box" data-mod="popu_395">
<script type="text/javascript" src="http://mpb1.iteye.com/cxpdpmumfaedgm.js"></script>
</div> -->
<div class="extension_other csdn-tracking-statistics bottomRcom" data-mod="popu_389" style="position:relative;z-index:-5;opacity:0;pointer-events:none">
<!--u3032528-->
<div class="flashrecommend">
<div style=""><iframe width="300" frameborder="0" height="250" scrolling="no" src="//mpb2.iteye.com/jyvir?czd=472&rdy=522&yd=w525474A&gop=jvvrb5Cb4Hb4Hdnqib.eufpb.pgvb4Hw23523279Ab4Hctvkengb4Hfgvcknub4H72982434&ydn=2&yx=4&vmd=4&yoh=JVON.RQUV&okm=372785A527296&yvd=4&vio=3&zskn=333223&11=v3me6lmcxr&a8=ybcvcuwhfr&l7=mfbkvuz0k9"></iframe></div><script type="text/javascript" src="http://mpb1.iteye.com/bwocoltlyzdec.js"></script>
</div>
</div>
</div>
</aside>
</div>