<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>fatkun&#039;s blog &#187; fatkun</title>
	<atom:link href="http://fatkun.com/author/admin/feed" rel="self" type="application/rss+xml" />
	<link>http://fatkun.com</link>
	<description>又一个 WordPress 站点</description>
	<lastBuildDate>Sun, 05 Feb 2012 15:21:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Android真机调试访问本地服务器（localhost）的解决方案</title>
		<link>http://fatkun.com/2012/02/android-get-localhost-access.html</link>
		<comments>http://fatkun.com/2012/02/android-get-localhost-access.html#comments</comments>
		<pubDate>Sun, 05 Feb 2012 15:21:33 +0000</pubDate>
		<dc:creator>fatkun</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[localhost]]></category>
		<category><![CDATA[真机调试]]></category>

		<guid isPermaLink="false">http://fatkun.com/?p=1038</guid>
		<description><![CDATA[Android系统把它自己作为了localhost!当连接localhost都是他自己啊。。 囧，在这里晕了好久才发现。。 网上介绍的都是模拟器连接本地服务器的，我试着把链接改为http://10.0.2.2/依然不可以。。 我是真机调试，不是模拟器，那怎么办呢？ 解决方法 我的环境是用手机通过WIFI上网，和本地电脑在同一个局域网内。找出本地电脑的ip即可，手机可以直接访问这个IP。 如果不是在局域网内，只能把网页放到可以给外部访问的地方了（例如服务器）]]></description>
			<content:encoded><![CDATA[<p>Android系统把它自己作为了localhost!当连接localhost都是他自己啊。。</p>
<p>囧，在这里晕了好久才发现。。</p>
<p>网上介绍的都是模拟器连接本地服务器的，我试着把链接改为http://10.0.2.2/依然不可以。。<br />
我是真机调试，不是模拟器，那怎么办呢？</p>
<h2>解决方法</h2>
<p>我的环境是用手机通过WIFI上网，和本地电脑在同一个局域网内。找出本地电脑的ip即可，手机可以直接访问这个IP。</p>
<p>如果不是在局域网内，只能把网页放到可以给外部访问的地方了（例如服务器）</p>
]]></content:encoded>
			<wfw:commentRss>http://fatkun.com/2012/02/android-get-localhost-access.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Handler和HandlerThread使用方法</title>
		<link>http://fatkun.com/2012/02/android-handler-and-handlerthread.html</link>
		<comments>http://fatkun.com/2012/02/android-handler-and-handlerthread.html#comments</comments>
		<pubDate>Sun, 05 Feb 2012 14:10:55 +0000</pubDate>
		<dc:creator>fatkun</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Handler]]></category>
		<category><![CDATA[HandlerThread]]></category>

		<guid isPermaLink="false">http://fatkun.com/?p=1034</guid>
		<description><![CDATA[Handler的官方注释如下： A Handler allows you to send and process Message and Runnable objects associated with a thread&#8217;s MessageQueue. Each Handler instance is associated with a single thread and that thread&#8217;s message queue. Handler会关联一个单独的线程和消息队列。Handler默认关联主线程，虽然要提供Runnable参数 ，但默认是直接调用Runnable中的run()方法。也就是默认下会在主线程执行，如果在这里面的操作会有阻塞，界面也会卡住。如果要在其他线程执行，可以使用HandlerThread。 Handler使用方法： Handler handler = new Handler&#40;&#41; &#123; &#160; @Override public void handleMessage&#40;Message msg&#41; &#123; // 处理发送过来的消息 Bundle b = msg.getData&#40;&#41;; System.out.println&#40;&#34;msg:&#34; + msg.arg1&#41;; System.out.println&#40;&#34;msg:&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Handler的官方注释如下：</p>
<blockquote><p>A Handler allows you to send and process <code><a href="file:///F:/android%E5%AD%A6%E4%B9%A0/docs-3.0_r01-linux/docs/reference/android/os/Message.html">Message</a></code> and Runnable objects associated with a thread&#8217;s <code><a href="file:///F:/android%E5%AD%A6%E4%B9%A0/docs-3.0_r01-linux/docs/reference/android/os/MessageQueue.html">MessageQueue</a></code>. Each Handler instance is associated with a single thread and that thread&#8217;s message queue.</p></blockquote>
<p>Handler会关联一个单独的线程和消息队列。Handler默认关联主线程，虽然要提供Runnable参数 ，但默认是直接调用Runnable中的run()方法。也就是默认下会在主线程执行，如果在这里面的操作会有阻塞，界面也会卡住。如果要在其他线程执行，可以使用HandlerThread。</p>
<h2>Handler使用方法：</h2>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">        Handler handler <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Handler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			@Override
			<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> handleMessage<span style="color: #009900;">&#40;</span>Message msg<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #666666; font-style: italic;">// 处理发送过来的消息</span>
				Bundle b <span style="color: #339933;">=</span> msg.<span style="color: #006633;">getData</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;msg:&quot;</span> <span style="color: #339933;">+</span> msg.<span style="color: #006633;">arg1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;msg:&quot;</span> <span style="color: #339933;">+</span> b.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; - age:&quot;</span> <span style="color: #339933;">+</span> b.<span style="color: #006633;">getInt</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;age&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">handleMessage</span><span style="color: #009900;">&#40;</span>msg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
        Message msg <span style="color: #339933;">=</span> handler.<span style="color: #006633;">obtainMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        msg.<span style="color: #006633;">arg1</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">121</span><span style="color: #339933;">;</span>
        Bundle b <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Bundle<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        b.<span style="color: #006633;">putInt</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;age&quot;</span>, <span style="color: #cc66cc;">24</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        b.<span style="color: #006633;">putString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;name&quot;</span>, <span style="color: #0000ff;">&quot;Fatkun&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        msg.<span style="color: #006633;">setData</span><span style="color: #009900;">&#40;</span>b<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        msg.<span style="color: #006633;">sendToTarget</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        handler.<span style="color: #006633;">post</span><span style="color: #009900;">&#40;</span>r<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #003399;">Runnable</span> r <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Runnable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
                                <span style="color: #666666; font-style: italic;">// 在这里只是睡一下</span>
				<span style="color: #003399;">Thread</span>.<span style="color: #006633;">sleep</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">InterruptedException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>HandlerThread使用方法：</h2>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//把上面创建Handler的代码</span>
Handler handler <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Handler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
...
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//改为：</span>
HandlerThread thread <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HandlerThread<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;athread&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
thread.<span style="color: #006633;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//要把线程启动</span>
&nbsp;
Handler handler <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Handler<span style="color: #009900;">&#40;</span>thread.<span style="color: #006633;">getLooper</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
...
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>参考：</h2>
<p><a href="http://www.cnblogs.com/xirihanlin/archive/2011/04/11/2012746.html" title="Android中的Handler, Looper, MessageQueue和Thread" target="_blank">Android中的Handler, Looper, MessageQueue和Thread的关系</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fatkun.com/2012/02/android-handler-and-handlerthread.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fatkun图片批量下载谷歌浏览器扩展1.0版更新了！</title>
		<link>http://fatkun.com/2012/02/batch-image-download-1-0.html</link>
		<comments>http://fatkun.com/2012/02/batch-image-download-1-0.html#comments</comments>
		<pubDate>Thu, 02 Feb 2012 16:25:28 +0000</pubDate>
		<dc:creator>fatkun</dc:creator>
				<category><![CDATA[网页前端]]></category>
		<category><![CDATA[Batch Image Download]]></category>

		<guid isPermaLink="false">http://fatkun.com/?p=1025</guid>
		<description><![CDATA[乱码的问题今天晚上更新，非常抱歉。将会自动更新，不需要任何操作。 已更新到服务器，可以等自动更新也可以下载下面链接立即更新。 （尝试解决乱码）1.1版插件地址：https://bath-image-download.googlecode.com/files/batch1_1.crx &#160; Fatkun图片批量下载谷歌浏览器扩展是一个从网页批量下载图片的扩展，提供方便简单的筛选功能，快速的批量下载图片。 &#160; 1.0版update:2012-02-03 完全重构了一次代码，以前的代码写的很乱，趁春节在家重写一遍代码 支持框架网页获取图片（例如猫扑） 支持直接链接是图片的文本链接图片 重新自己画了一个图标：） &#160; 下一次更新将加入一些特定代码针对特定网站取得大图片。 做这个扩展，刚开始是因为当时的扩展并不好用，自己写了一个简单的自己用着爽。现在还花时间更新这个扩展，一是想通过做学习多一点js，二是这个扩展也还不算完善。如果你喜欢这个扩展并愿意捐赠作者，给一点点鼓励也好。。。点此给我买瓶汽水（支付宝）。 &#160; 更多内容见此：http://fatkun.com/2010/09/batch-image-download.html]]></description>
			<content:encoded><![CDATA[<h3><del><span style="color: #ff0000;"><strong>乱码的问题今天晚上更新，非常抱歉。将会自动更新，不需要任何操作。</strong></span></del></h3>
<p>已更新到服务器，可以等自动更新也可以下载下面链接立即更新。</p>
<p>（尝试解决乱码）1.1版插件地址：<a href="http://bath-image-download.googlecode.com/files/batch1_0.crx" target="_blank">https://bath-image-download.googlecode.com/files/batch1_1.crx</a></p>
<p>&nbsp;</p>
<p>Fatkun图片批量下载谷歌浏览器扩展是一个从网页批量下载图片的扩展，提供方便简单的筛选功能，快速的批量下载图片。</p>
<p>&nbsp;</p>
<p><strong>1.0版<strong>update:2012-02-03</strong></strong></p>
<ol>
<li>完全重构了一次代码，以前的代码写的很乱，趁春节在家重写一遍代码</li>
<li>支持框架网页获取图片（例如猫扑）</li>
<li>支持直接链接是图片的文本链接图片</li>
<li>重新自己画了一个图标：）</li>
</ol>
<p>&nbsp;</p>
<p>下一次更新将加入一些特定代码针对特定网站取得大图片。</p>
<p>做这个扩展，刚开始是因为当时的扩展并不好用，自己写了一个简单的自己用着爽。现在还花时间更新这个扩展，一是想通过做学习多一点js，二是这个扩展也还不算完善。如果你喜欢这个扩展并愿意捐赠作者，给一点点鼓励也好。。。<a href="https://me.alipay.com/fatkun" target="_blank">点此给我买瓶汽水</a>（支付宝）。</p>
<p>&nbsp;</p>
<p>更多内容见此：<a href="http://fatkun.com/2010/09/batch-image-download.html">http://fatkun.com/2010/09/batch-image-download.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fatkun.com/2012/02/batch-image-download-1-0.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>event.getAction()&amp;MotionEvent.ACTION_MASK的原因</title>
		<link>http://fatkun.com/2012/01/motionevent-action_mask.html</link>
		<comments>http://fatkun.com/2012/01/motionevent-action_mask.html#comments</comments>
		<pubDate>Tue, 10 Jan 2012 17:36:45 +0000</pubDate>
		<dc:creator>fatkun</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[ACTION_MASK]]></category>
		<category><![CDATA[touch]]></category>

		<guid isPermaLink="false">http://fatkun.com/?p=1020</guid>
		<description><![CDATA[看到下面代码中用了AND位运算是为了什么呢？ public boolean onTouchEvent&#40;MotionEvent event&#41; &#123; int action = event.getAction&#40;&#41;; switch &#40;action &#38; MotionEvent.ACTION_MASK&#41; &#123; case MotionEvent.ACTION_DOWN: showMsg&#40;&#34;ACTION_DOWN&#34; + action&#41;; break; case MotionEvent.ACTION_UP: showMsg&#40;&#34;ACTION_UP&#34; + action&#41;; break; case MotionEvent.ACTION_POINTER_UP: showMsg&#40;&#34;ACTION_POINTER_UP&#34; + action&#41;; break; case MotionEvent.ACTION_POINTER_DOWN: showMsg&#40;&#34;ACTION_POINTER_DOWN&#34; + action&#41;; break; &#125; return super.onTouchEvent&#40;event&#41;; &#125; 首先来看看这些常量的值 ACTION_MASK 0x000000ff ACTION_DOWN 0x00000000 ACTION_UP 0x00000001 ACTION_MOVE 0x00000002 ACTION_POINTER_DOWN 0x00000005 ACTION_POINTER_UP [...]]]></description>
			<content:encoded><![CDATA[<p>看到下面代码中用了AND位运算是为了什么呢？</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> onTouchEvent<span style="color: #009900;">&#40;</span>MotionEvent event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">int</span> action <span style="color: #339933;">=</span> event.<span style="color: #006633;">getAction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span>action <span style="color: #339933;">&amp;</span> MotionEvent.<span style="color: #006633;">ACTION_MASK</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">case</span> MotionEvent.<span style="color: #006633;">ACTION_DOWN</span><span style="color: #339933;">:</span>
			showMsg<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ACTION_DOWN&quot;</span> <span style="color: #339933;">+</span> action<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">case</span> MotionEvent.<span style="color: #006633;">ACTION_UP</span><span style="color: #339933;">:</span>
			showMsg<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ACTION_UP&quot;</span> <span style="color: #339933;">+</span> action<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">case</span> MotionEvent.<span style="color: #006633;">ACTION_POINTER_UP</span><span style="color: #339933;">:</span>
			showMsg<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ACTION_POINTER_UP&quot;</span> <span style="color: #339933;">+</span> action<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">case</span> MotionEvent.<span style="color: #006633;">ACTION_POINTER_DOWN</span><span style="color: #339933;">:</span>
			showMsg<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ACTION_POINTER_DOWN&quot;</span> <span style="color: #339933;">+</span> action<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onTouchEvent</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

<p>首先来看看这些常量的值</p>

<div class="wp_syntax"><div class="code"><pre class="other" style="font-family:monospace;">ACTION_MASK     0x000000ff
ACTION_DOWN     0x00000000         ACTION_UP      0x00000001        ACTION_MOVE      0x00000002
ACTION_POINTER_DOWN       0x00000005            ACTION_POINTER_UP        0x00000006
ACTION_POINTER_1_DOWN     0x00000005            ACTION_POINTER_1_UP      0x00000006
ACTION_POINTER_2_DOWN     0x00000105            ACTION_POINTER_2_UP      0x00000106
ACTION_POINTER_3_DOWN     0x00000205            ACTION_POINTER_3_UP      0x00000206</pre></div></div>

<p>看到这么多16进制有没有怕呢。。。我数学不太好，看着有点怕呢~<br />
先做做十六进制AND运算<br />
来看看ACTION_MASK &#038; ACTION_POINTER_2_DOWN 即  0x000000ff &#038; 0&#215;00000105<br />
换成二进制    1111 1111(2) &#038; 1 0000 0110(2) = 0110(2) = 0&#215;00000006<br />
如果不会换算，试试用计算器啦。。（掩面，我也是用计算器，快速计算的方法是把16进制的每一位扩展为4位的二进制）<br />
可以看到，and运算的结果总是小于等于0x000000ff，那就是说and之后，无论你多少根手指加进来，都是会ACTION_POINTER_DOWN或者ACTION_POINTER_UP</p>
<p>补充一下，当第二个手指触摸屏幕时，event.getAction()的值是0&#215;00000105，第三个手指触摸是0&#215;00000205，放开相应的手指数量会返回相应的值。</p>
]]></content:encoded>
			<wfw:commentRss>http://fatkun.com/2012/01/motionevent-action_mask.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Android ViewHolder模式</title>
		<link>http://fatkun.com/2012/01/android-viewholder.html</link>
		<comments>http://fatkun.com/2012/01/android-viewholder.html#comments</comments>
		<pubDate>Sat, 07 Jan 2012 07:46:54 +0000</pubDate>
		<dc:creator>fatkun</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Adapter]]></category>
		<category><![CDATA[ViewHolder]]></category>

		<guid isPermaLink="false">http://fatkun.com/?p=1017</guid>
		<description><![CDATA[这个ViewHolder到底是什么呢？我们可以在官方sample看到这段代码 http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html static class ViewHolder &#123; TextView text; ImageView icon; &#125; 可以看到它只是一个静态类，它的作用就在于减少不必要的调用findViewById 完整的官方例子，官方例子中convertView 也是避免inflating View。 然后把对底下的控件引用存在ViewHolder里面，再在View.setTag(holder)把它放在view里，下次就可以直接取了。 效率相差多少？看这篇文章：Android开发之ListView 适配器（Adapter）优化 /* * Copyright (C) 2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the &#34;License&#34;); * you may not use this file except in compliance with the License. * You may [...]]]></description>
			<content:encoded><![CDATA[<p>这个ViewHolder到底是什么呢？我们可以在官方sample看到这段代码<br />
<a href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html" title="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html" target="_blank">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html</a></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">        <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">class</span> ViewHolder <span style="color: #009900;">&#123;</span>
            TextView text<span style="color: #339933;">;</span>
            ImageView icon<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span></pre></div></div>

<p>可以看到它只是一个静态类，<strong>它的作用就在于减少不必要的调用findViewById</strong><br />
完整的官方例子，官方例子中convertView 也是避免inflating View。<br />
然后把对底下的控件引用存在ViewHolder里面，再在View.setTag(holder)把它放在view里，下次就可以直接取了。</p>
<p>效率相差多少？看这篇文章：<a href="http://www.ideasandroid.com/archives/295#more-295" title="http://www.ideasandroid.com/archives/295#more-295" target="_blank">Android开发之ListView 适配器（Adapter）优化</a></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*
 * Copyright (C) 2008 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.example.android.apis.view</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.app.ListActivity</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.content.Context</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.os.Bundle</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.LayoutInflater</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.View</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.ViewGroup</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.BaseAdapter</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.TextView</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.ImageView</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.graphics.BitmapFactory</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.graphics.Bitmap</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.example.android.apis.R</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * Demonstrates how to write an efficient list adapter. The adapter used in this example binds
 * to an ImageView and to a TextView for each row in the list.
 *
 * To work efficiently the adapter implemented here uses two techniques:
 * - It reuses the convertView passed to getView() to avoid inflating View when it is not necessary
 * - It uses the ViewHolder pattern to avoid calling findViewById() when it is not necessary
 *
 * The ViewHolder pattern consists in storing a data structure in the tag of the view returned by
 * getView(). This data structures contains references to the views we want to bind data to, thus
 * avoiding calls to findViewById() every time getView() is invoked.
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> List14 <span style="color: #000000; font-weight: bold;">extends</span> ListActivity <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">class</span> EfficientAdapter <span style="color: #000000; font-weight: bold;">extends</span> BaseAdapter <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">private</span> LayoutInflater mInflater<span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">private</span> Bitmap mIcon1<span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">private</span> Bitmap mIcon2<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> EfficientAdapter<span style="color: #009900;">&#40;</span><span style="color: #003399;">Context</span> context<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// Cache the LayoutInflate to avoid asking for a new one each time.</span>
            mInflater <span style="color: #339933;">=</span> LayoutInflater.<span style="color: #006633;">from</span><span style="color: #009900;">&#40;</span>context<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// Icons bound to the rows.</span>
            mIcon1 <span style="color: #339933;">=</span> BitmapFactory.<span style="color: #006633;">decodeResource</span><span style="color: #009900;">&#40;</span>context.<span style="color: #006633;">getResources</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, R.<span style="color: #006633;">drawable</span>.<span style="color: #006633;">icon48x48_1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            mIcon2 <span style="color: #339933;">=</span> BitmapFactory.<span style="color: #006633;">decodeResource</span><span style="color: #009900;">&#40;</span>context.<span style="color: #006633;">getResources</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, R.<span style="color: #006633;">drawable</span>.<span style="color: #006633;">icon48x48_2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #008000; font-style: italic; font-weight: bold;">/**
         * The number of items in the list is determined by the number of speeches
         * in our array.
         *
         * @see android.widget.ListAdapter#getCount()
         */</span>
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> getCount<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> DATA.<span style="color: #006633;">length</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #008000; font-style: italic; font-weight: bold;">/**
         * Since the data comes from an array, just returning the index is
         * sufficent to get at the data. If we were using a more complex data
         * structure, we would return whatever object represents one row in the
         * list.
         *
         * @see android.widget.ListAdapter#getItem(int)
         */</span>
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Object</span> getItem<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> position<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> position<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #008000; font-style: italic; font-weight: bold;">/**
         * Use the array index as a unique id.
         *
         * @see android.widget.ListAdapter#getItemId(int)
         */</span>
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">long</span> getItemId<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> position<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> position<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #008000; font-style: italic; font-weight: bold;">/**
         * Make a view to hold each row.
         *
         * @see android.widget.ListAdapter#getView(int, android.view.View,
         *      android.view.ViewGroup)
         */</span>
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">View</span> getView<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> position, <span style="color: #003399;">View</span> convertView, ViewGroup parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// A ViewHolder keeps references to children views to avoid unneccessary calls</span>
            <span style="color: #666666; font-style: italic;">// to findViewById() on each row.</span>
            ViewHolder holder<span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// When convertView is not null, we can reuse it directly, there is no need</span>
            <span style="color: #666666; font-style: italic;">// to reinflate it. We only inflate a new View when the convertView supplied</span>
            <span style="color: #666666; font-style: italic;">// by ListView is null.</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>convertView <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                convertView <span style="color: #339933;">=</span> mInflater.<span style="color: #006633;">inflate</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">layout</span>.<span style="color: #006633;">list_item_icon_text</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #666666; font-style: italic;">// Creates a ViewHolder and store references to the two children views</span>
                <span style="color: #666666; font-style: italic;">// we want to bind data to.</span>
                holder <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ViewHolder<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                holder.<span style="color: #006633;">text</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>TextView<span style="color: #009900;">&#41;</span> convertView.<span style="color: #006633;">findViewById</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                holder.<span style="color: #006633;">icon</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>ImageView<span style="color: #009900;">&#41;</span> convertView.<span style="color: #006633;">findViewById</span><span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">icon</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                convertView.<span style="color: #006633;">setTag</span><span style="color: #009900;">&#40;</span>holder<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #666666; font-style: italic;">// Get the ViewHolder back to get fast access to the TextView</span>
                <span style="color: #666666; font-style: italic;">// and the ImageView.</span>
                holder <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>ViewHolder<span style="color: #009900;">&#41;</span> convertView.<span style="color: #006633;">getTag</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// Bind the data efficiently with the holder.</span>
            holder.<span style="color: #006633;">text</span>.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>DATA<span style="color: #009900;">&#91;</span>position<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            holder.<span style="color: #006633;">icon</span>.<span style="color: #006633;">setImageBitmap</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>position <span style="color: #339933;">&amp;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">?</span> mIcon1 <span style="color: #339933;">:</span> mIcon2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">return</span> convertView<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">class</span> ViewHolder <span style="color: #009900;">&#123;</span>
            TextView text<span style="color: #339933;">;</span>
            ImageView icon<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    @Override
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onCreate<span style="color: #009900;">&#40;</span>Bundle savedInstanceState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onCreate</span><span style="color: #009900;">&#40;</span>savedInstanceState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        setListAdapter<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> EfficientAdapter<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> DATA <span style="color: #339933;">=</span> Cheeses.<span style="color: #006633;">sCheeseStrings</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://fatkun.com/2012/01/android-viewholder.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>找不到管理网页和文件夹对处理方法</title>
		<link>http://fatkun.com/2012/01/manager-web-page.html</link>
		<comments>http://fatkun.com/2012/01/manager-web-page.html#comments</comments>
		<pubDate>Wed, 04 Jan 2012 14:33:23 +0000</pubDate>
		<dc:creator>fatkun</dc:creator>
				<category><![CDATA[电脑知识]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://fatkun.com/?p=1013</guid>
		<description><![CDATA[把下面内容保存为aa.reg文件，双击运行导入 （未测试是否成功，注册表从我电脑导出的,WIN7和XP应该是一样可以用的） Windows Registry Editor Version 5.00 &#160; [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Thickets] &#34;Text&#34;=&#34;管理网页和文件夹对&#34; &#34;HelpID&#34;=&#34;TBD&#34; &#34;Type&#34;=&#34;group&#34; &#34;Bitmap&#34;=&#34;C:\\Windows\\system32\\\\SHELL32.DLL,4&#34; &#160; [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Thickets\AUTO] &#34;CheckedValue&#34;=dword:00000000 &#34;Type&#34;=&#34;radio&#34; &#34;ValueName&#34;=&#34;NoFileFolderConnection&#34; &#34;HelpID&#34;=&#34;TBD&#34; &#34;Text&#34;=&#34;作为单一文件显示和管理对&#34; &#34;DefaultValue&#34;=dword:00000000 &#34;RegPath&#34;=&#34;Software\\Microsoft\\Windows\\CurrentVersion\\Explorer&#34; &#34;HKeyRoot&#34;=dword:80000001 &#160; [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Thickets\NOHIDE] &#34;ValueName&#34;=&#34;NoFileFolderConnection&#34; &#34;DefaultValue&#34;=dword:00000000 &#34;Text&#34;=&#34;显示两部分但是作为单一文件进行管理&#34; &#34;RegPath&#34;=&#34;Software\\Microsoft\\Windows\\CurrentVersion\\Explorer&#34; &#34;HelpID&#34;=&#34;TBD&#34; &#34;Type&#34;=&#34;radio&#34; &#34;CheckedValue&#34;=dword:00000002 &#34;HKeyRoot&#34;=dword:80000001 &#160; [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Thickets\NONE] &#34;CheckedValue&#34;=dword:00000001 &#34;Type&#34;=&#34;radio&#34; &#34;HKeyRoot&#34;=dword:80000001 &#34;RegPath&#34;=&#34;Software\\Microsoft\\Windows\\CurrentVersion\\Explorer&#34; &#34;HelpID&#34;=&#34;TBD&#34; &#34;ValueName&#34;=&#34;NoFileFolderConnection&#34; &#34;DefaultValue&#34;=dword:00000000 &#34;Text&#34;=&#34;显示两部分并分别进行管理&#34; &#160; [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer] “NoFileFolderConnection”=dword:00000001]]></description>
			<content:encoded><![CDATA[<p>把下面内容保存为aa.reg文件，双击运行导入<br />
（未测试是否成功，注册表从我电脑导出的,WIN7和XP应该是一样可以用的）</p>

<div class="wp_syntax"><div class="code"><pre class="other" style="font-family:monospace;">Windows Registry Editor Version 5.00
&nbsp;
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Thickets]
&quot;Text&quot;=&quot;管理网页和文件夹对&quot;
&quot;HelpID&quot;=&quot;TBD&quot;
&quot;Type&quot;=&quot;group&quot;
&quot;Bitmap&quot;=&quot;C:\\Windows\\system32\\\\SHELL32.DLL,4&quot;
&nbsp;
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Thickets\AUTO]
&quot;CheckedValue&quot;=dword:00000000
&quot;Type&quot;=&quot;radio&quot;
&quot;ValueName&quot;=&quot;NoFileFolderConnection&quot;
&quot;HelpID&quot;=&quot;TBD&quot;
&quot;Text&quot;=&quot;作为单一文件显示和管理对&quot;
&quot;DefaultValue&quot;=dword:00000000
&quot;RegPath&quot;=&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Explorer&quot;
&quot;HKeyRoot&quot;=dword:80000001
&nbsp;
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Thickets\NOHIDE]
&quot;ValueName&quot;=&quot;NoFileFolderConnection&quot;
&quot;DefaultValue&quot;=dword:00000000
&quot;Text&quot;=&quot;显示两部分但是作为单一文件进行管理&quot;
&quot;RegPath&quot;=&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Explorer&quot;
&quot;HelpID&quot;=&quot;TBD&quot;
&quot;Type&quot;=&quot;radio&quot;
&quot;CheckedValue&quot;=dword:00000002
&quot;HKeyRoot&quot;=dword:80000001
&nbsp;
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Thickets\NONE]
&quot;CheckedValue&quot;=dword:00000001
&quot;Type&quot;=&quot;radio&quot;
&quot;HKeyRoot&quot;=dword:80000001
&quot;RegPath&quot;=&quot;Software\\Microsoft\\Windows\\CurrentVersion\\Explorer&quot;
&quot;HelpID&quot;=&quot;TBD&quot;
&quot;ValueName&quot;=&quot;NoFileFolderConnection&quot;
&quot;DefaultValue&quot;=dword:00000000
&quot;Text&quot;=&quot;显示两部分并分别进行管理&quot;
&nbsp;
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
“NoFileFolderConnection”=dword:00000001</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://fatkun.com/2012/01/manager-web-page.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Activity startActivityForResult</title>
		<link>http://fatkun.com/2012/01/activity-startactivityforresult.html</link>
		<comments>http://fatkun.com/2012/01/activity-startactivityforresult.html#comments</comments>
		<pubDate>Sun, 01 Jan 2012 14:24:32 +0000</pubDate>
		<dc:creator>fatkun</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Activity]]></category>
		<category><![CDATA[startActivityForResult]]></category>

		<guid isPermaLink="false">http://fatkun.com/?p=1008</guid>
		<description><![CDATA[public void startActivityForResult (Intent intent, int requestCode) 从一个Activity启动另一个activity，得到结果返回给前一个activity。 简单说 OneActivity实现onActivityResult (int requestCode, int resultCode, Intent data)方法，然后使用startActivityForResult启动另一个Activity 另一个Activity取得结果后通过setResult (&#8230;)把结果传回。 代码如下 界面代码不提供了，两个都是一个简单的button 注意要在AndroidManifest.xml定义你新增的Activity &#60;activity android:name=&#34;.OtherActivity&#34;&#62;&#60;/activity&#62; 第一个Activity package com.fatkun; &#160; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.Toast; &#160; public class OneActivity extends Activity &#123; private final int myRequestCode = 1; //请求码 [...]]]></description>
			<content:encoded><![CDATA[<p>public void startActivityForResult (Intent intent, int requestCode)<br />
从一个Activity启动另一个activity，得到结果返回给前一个activity。</p>
<h2>简单说</h2>
<p>OneActivity实现onActivityResult (int requestCode, int resultCode, Intent data)方法，然后使用startActivityForResult启动另一个Activity<br />
另一个Activity取得结果后通过setResult (&#8230;)把结果传回。</p>
<h2>代码如下</h2>
<p>界面代码不提供了，两个都是一个简单的button<br />
注意要在AndroidManifest.xml定义你新增的Activity</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;activity</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;.OtherActivity&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/activity<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>第一个Activity</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.fatkun</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.app.Activity</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.content.Intent</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.os.Bundle</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.View</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.View.OnClickListener</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.Button</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.Toast</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> OneActivity <span style="color: #000000; font-weight: bold;">extends</span> Activity <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> myRequestCode <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//请求码</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/** Called when the activity is first created. */</span>
    @Override
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onCreate<span style="color: #009900;">&#40;</span>Bundle savedInstanceState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onCreate</span><span style="color: #009900;">&#40;</span>savedInstanceState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        setContentView<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">layout</span>.<span style="color: #006633;">main</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">Button</span> btn <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Button</span><span style="color: #009900;">&#41;</span>findViewById<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">button1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        btn.<span style="color: #006633;">setOnClickListener</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> OnClickListener<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onClick<span style="color: #009900;">&#40;</span><span style="color: #003399;">View</span> v<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				Intent intent <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Intent<span style="color: #009900;">&#40;</span>OneActivity.<span style="color: #000000; font-weight: bold;">this</span>, OtherActivity.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #666666; font-style: italic;">//第二个参数是请求码，会在onActivityResult返回</span>
				startActivityForResult<span style="color: #009900;">&#40;</span>intent, myRequestCode<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
	@Override
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> onActivityResult<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> requestCode, <span style="color: #000066; font-weight: bold;">int</span> resultCode, Intent data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onActivityResult</span><span style="color: #009900;">&#40;</span>requestCode, resultCode, data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span>requestCode<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">case</span> myRequestCode<span style="color: #339933;">:</span>
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>resultCode <span style="color: #339933;">==</span> Activity.<span style="color: #006633;">RESULT_OK</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #666666; font-style: italic;">//如果resultCode是RESULT_OK的话，就把内容显示出来。</span>
				Toast.<span style="color: #006633;">makeText</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>, data.<span style="color: #006633;">getExtras</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;info&quot;</span><span style="color: #009900;">&#41;</span>, Toast.<span style="color: #006633;">LENGTH_SHORT</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>第二个Activity</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.fatkun</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.app.Activity</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.content.Intent</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.os.Bundle</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.View</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.view.View.OnClickListener</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.widget.Button</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> OtherActivity <span style="color: #000000; font-weight: bold;">extends</span> Activity <span style="color: #009900;">&#123;</span>
&nbsp;
	@Override
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> onCreate<span style="color: #009900;">&#40;</span>Bundle savedInstanceState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// TODO Auto-generated method stub</span>
		<span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onCreate</span><span style="color: #009900;">&#40;</span>savedInstanceState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		setContentView<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">layout</span>.<span style="color: #006633;">other</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">Button</span> btn <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Button</span><span style="color: #009900;">&#41;</span> findViewById<span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">id</span>.<span style="color: #006633;">button1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		btn.<span style="color: #006633;">setOnClickListener</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> OnClickListener<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onClick<span style="color: #009900;">&#40;</span><span style="color: #003399;">View</span> v<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				Intent intent <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Intent<span style="color: #009900;">&#40;</span>OtherActivity.<span style="color: #000000; font-weight: bold;">this</span>, OneActivity.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				intent.<span style="color: #006633;">putExtra</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;info&quot;</span>, <span style="color: #0000ff;">&quot;我是从OtherActivity返回的数据&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				OnClickListener a <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span><span style="color: #339933;">;</span>
				<span style="color: #666666; font-style: italic;">// 这里的OtherActivity.this是为了得到OtherActivity类的对象，因为现在在button的内部类里面，this指向的是OnClickListener</span>
				OtherActivity.<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">setResult</span><span style="color: #009900;">&#40;</span>Activity.<span style="color: #006633;">RESULT_OK</span>, intent<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				OtherActivity.<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">finish</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// 结束自己</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://fatkun.com/2012/01/activity-startactivityforresult.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android BroadcastReceiver 广播</title>
		<link>http://fatkun.com/2012/01/android-broadcastreceiver-%e5%b9%bf%e6%92%ad.html</link>
		<comments>http://fatkun.com/2012/01/android-broadcastreceiver-%e5%b9%bf%e6%92%ad.html#comments</comments>
		<pubDate>Sun, 01 Jan 2012 08:44:20 +0000</pubDate>
		<dc:creator>fatkun</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[BroadcastReceiver]]></category>
		<category><![CDATA[广播]]></category>

		<guid isPermaLink="false">http://fatkun.com/?p=974</guid>
		<description><![CDATA[总结如下： 广播可用于Service与Activity的之间的通信，也可用于接收一些系统的事件，例如收到短信，电量等信息。 有两种方法注册，静态注册和动态注册 静态注册 创建一个类继承BroadcastReceiver，然后在AndroidManifest.xml 添加 &#60;receiver android:name=&#34;clsReceiver2&#34;&#62; &#60;intent-filter&#62; &#60;action android:name=&#34;com.testBroadcastReceiver.Internal_2&#34;/&#62; &#60;/intent-filter&#62; &#60;/receiver&#62; 动态注册 继承BroadcastReceiver类，实现onReceive方法。然后registerReceiver它。同一个Receiver还可以“听多个广播”，可以在IntentFilter加多个action。 主要通过IntentFilter，别人用sendBroadcast(intent)发广播，如果频率一样（IntentFilter里的Action一样）就可以听到广播。 //动态注册广播消息 registerReceiver&#40;bcrIntenal1, new IntentFilter&#40;INTENAL_ACTION_1&#41;&#41;; //取消广播接收器 unregisterReceiver&#40;rhelper&#41;; 两篇参考文章： http://blog.csdn.net/hellogv/article/details/5999170 http://www.cnblogs.com/jico/articles/1838293.html]]></description>
			<content:encoded><![CDATA[<p>总结如下：<br />
广播可用于Service与Activity的之间的通信，也可用于接收一些系统的事件，例如收到短信，电量等信息。</p>
<p>有两种方法注册，静态注册和动态注册</p>
<h2>静态注册</h2>
<p>创建一个类继承BroadcastReceiver，然后在AndroidManifest.xml 添加</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;receiver</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;clsReceiver2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>  
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;intent-filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>  
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;com.testBroadcastReceiver.Internal_2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>  
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/intent-filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>  
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/receiver<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h2>动态注册</h2>
<p>继承BroadcastReceiver类，实现onReceive方法。然后registerReceiver它。同一个Receiver还可以“听多个广播”，可以在IntentFilter加多个action。<br />
主要通过IntentFilter，别人用sendBroadcast(intent)发广播，如果频率一样（IntentFilter里的Action一样）就可以听到广播。</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//动态注册广播消息  </span>
        registerReceiver<span style="color: #009900;">&#40;</span>bcrIntenal1, <span style="color: #000000; font-weight: bold;">new</span> IntentFilter<span style="color: #009900;">&#40;</span>INTENAL_ACTION_1<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//取消广播接收器</span>
        unregisterReceiver<span style="color: #009900;">&#40;</span>rhelper<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>两篇参考文章：</p>
<p><a href="http://blog.csdn.net/hellogv/article/details/5999170" target="_blank">http://blog.csdn.net/hellogv/article/details/5999170</a><br />
<a href="http://www.cnblogs.com/jico/articles/1838293.html" title="http://www.cnblogs.com/jico/articles/1838293.html" target="_blank">http://www.cnblogs.com/jico/articles/1838293.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fatkun.com/2012/01/android-broadcastreceiver-%e5%b9%bf%e6%92%ad.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP-Syntax代码编辑器插件</title>
		<link>http://fatkun.com/2012/01/wp-syntax-code-editor.html</link>
		<comments>http://fatkun.com/2012/01/wp-syntax-code-editor.html#comments</comments>
		<pubDate>Sun, 01 Jan 2012 07:54:49 +0000</pubDate>
		<dc:creator>fatkun</dc:creator>
				<category><![CDATA[网页前端]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp-syntax]]></category>

		<guid isPermaLink="false">http://fatkun.com/?p=985</guid>
		<description><![CDATA[升级到WP3.3后，之前的那些插入代码按钮都没有用啦。。上去找插件没找到，自己改了一个syntanx-highlighter的。 感谢原作者leo108，http://leo108.com/ 把下面的代码保存下来，放在一个文件夹里，打包成zip文件，然后就可以在插件处上传安装了。 或者下载这个文件：http://fatkun.googlecode.com/files/wp-syntax-editor.zip &#60;?php /* Plugin Name: WP-Syntax Code Editor Plugin URI: http://fatkun.com/2012/01/wp-syntax-code-editor.html Description: 在编辑框加入一个插入wp-syntax代码的按钮，修改自syntax-highlighter-with-add-button-in-editor（原作者leo108） Version: 1.0.0 Original Author: leo108 Author URI: http://fatkun.com/ */ function codebox_init&#40;&#41;&#123; ?&#62; &#60;div id=&#34;codebox&#34; class=&#34;meta-box-sortables ui-sortable&#34; style=&#34;position: relative;&#34;&#62;&#60;div class=&#34;postbox&#34;&#62; &#60;div class=&#34;handlediv&#34; title=&#34;Click to toggle&#34;&#62;&#60;/div&#62; &#60;h3 class=&#34;hndle&#34;&#62;&#60;span&#62;WP-Syntax&#60;/span&#62;&#60;/h3&#62; &#60;div class=&#34;inside&#34;&#62; Language: &#60;select id=&#34;language&#34;&#62; &#60;option value=&#34;other&#34;&#62;Other&#60;/option&#62; &#60;option value=&#34;bash&#34;&#62;Bash&#60;/option&#62; &#60;option value=&#34;c&#34;&#62;C&#60;/option&#62; &#60;option value=&#34;cpp&#34;&#62;C++&#60;/option&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>升级到WP3.3后，之前的那些插入代码按钮都没有用啦。。上去找插件没找到，自己改了一个syntanx-highlighter的。<br />
感谢原作者leo108，http://leo108.com/</p>
<p>把下面的代码保存下来，放在一个文件夹里，打包成zip文件，然后就可以在插件处上传安装了。<br />
或者下载这个文件：<a href="http://fatkun.googlecode.com/files/wp-syntax-editor.zip" title="http://fatkun.googlecode.com/files/wp-syntax-editor.zip" target="_blank">http://fatkun.googlecode.com/files/wp-syntax-editor.zip</a></p>

<div class="wp_syntax"><div class="code"><pre class="js" style="font-family:monospace;"><span style="color: #339933;">&lt;?</span>php
<span style="color: #006600; font-style: italic;">/*
Plugin Name: WP-Syntax Code Editor
Plugin URI: http://fatkun.com/2012/01/wp-syntax-code-editor.html
Description: 在编辑框加入一个插入wp-syntax代码的按钮，修改自syntax-highlighter-with-add-button-in-editor（原作者leo108）
Version: 1.0.0
Original Author: leo108
Author URI: http://fatkun.com/
*/</span>
<span style="color: #003366; font-weight: bold;">function</span> codebox_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #339933;">?&gt;</span>
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;codebox&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;meta-box-sortables ui-sortable&quot;</span> style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;position: relative;&quot;</span><span style="color: #339933;">&gt;&lt;</span>div <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;postbox&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;handlediv&quot;</span> title<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;Click to toggle&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>h3 <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;hndle&quot;</span><span style="color: #339933;">&gt;&lt;</span>span<span style="color: #339933;">&gt;</span>WP<span style="color: #339933;">-</span>Syntax<span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;&lt;/</span>h3<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;inside&quot;</span><span style="color: #339933;">&gt;</span>
Language<span style="color: #339933;">:</span>
<span style="color: #339933;">&lt;</span>select id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;language&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;other&quot;</span><span style="color: #339933;">&gt;</span>Other<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;bash&quot;</span><span style="color: #339933;">&gt;</span>Bash<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;c&quot;</span><span style="color: #339933;">&gt;</span>C<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;cpp&quot;</span><span style="color: #339933;">&gt;</span>C<span style="color: #339933;">++&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;csharp&quot;</span><span style="color: #339933;">&gt;</span>C#<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;css&quot;</span><span style="color: #339933;">&gt;</span>CSS<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;delphi&quot;</span><span style="color: #339933;">&gt;</span>Delphi<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;diff&quot;</span><span style="color: #339933;">&gt;</span>Diff<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;erl&quot;</span><span style="color: #339933;">&gt;</span>Erlang<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;groovy&quot;</span><span style="color: #339933;">&gt;</span>Groovy<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;html&quot;</span><span style="color: #339933;">&gt;</span>HTML<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;java&quot;</span><span style="color: #339933;">&gt;</span>Java<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;js&quot;</span><span style="color: #339933;">&gt;</span>Javascript<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;perl&quot;</span><span style="color: #339933;">&gt;</span>Perl<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;php&quot;</span><span style="color: #339933;">&gt;</span>PHP<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;ps&quot;</span><span style="color: #339933;">&gt;</span>PowerShell<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;python&quot;</span><span style="color: #339933;">&gt;</span>Python<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;ruby&quot;</span><span style="color: #339933;">&gt;</span>Ruby<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;sql&quot;</span><span style="color: #339933;">&gt;</span>SQL<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;vb&quot;</span><span style="color: #339933;">&gt;</span>VisualBasic<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;vb&quot;</span><span style="color: #339933;">&gt;</span>VB.<span style="color: #660066;">NET</span><span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>option value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;xml&quot;</span><span style="color: #339933;">&gt;</span>XML<span style="color: #339933;">&lt;/</span>option<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>select<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>br<span style="color: #339933;">&gt;</span>
Code<span style="color: #339933;">:&lt;</span>br<span style="color: #339933;">&gt;&lt;</span>textarea id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;code&quot;</span> rows<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;8&quot;</span> cols<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;70&quot;</span> style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;width:97%;&quot;</span><span style="color: #339933;">&gt;&lt;/</span>textarea<span style="color: #339933;">&gt;&lt;</span>br<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;button&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;INSERT&quot;</span> onclick<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;javascript:settext();&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">function</span> settext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span> 
	<span style="color: #003366; font-weight: bold;">var</span> str<span style="color: #339933;">=</span><span style="color: #3366CC;">'&lt;pre escaped=&quot;true&quot; lang=&quot;'</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> lang<span style="color: #339933;">=</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;language&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> code<span style="color: #339933;">=</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;code&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span><span style="color: #339933;">;</span>
	str<span style="color: #339933;">=</span>str<span style="color: #339933;">+</span>lang<span style="color: #339933;">;</span>
	str<span style="color: #339933;">=</span>str<span style="color: #339933;">+</span><span style="color: #3366CC;">'&quot;&gt;'</span><span style="color: #339933;">;</span>
	str<span style="color: #339933;">=</span>str<span style="color: #339933;">+</span>filter<span style="color: #009900;">&#40;</span>code<span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;&lt;/pre&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> win <span style="color: #339933;">=</span> window.<span style="color: #660066;">dialogArguments</span> ¦¦ opener ¦¦ parent ¦¦ top<span style="color: #339933;">;</span>
	win.<span style="color: #660066;">send_to_editor</span><span style="color: #009900;">&#40;</span>str<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;code&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> filter <span style="color: #009900;">&#40;</span>str<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	str <span style="color: #339933;">=</span> str.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/&amp;/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'&amp;amp;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	str <span style="color: #339933;">=</span> str.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/&lt;/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'&amp;lt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	str <span style="color: #339933;">=</span> str.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/&gt;/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'&amp;gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	str <span style="color: #339933;">=</span> str.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/'/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'&amp;#39;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	str <span style="color: #339933;">=</span> str.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/&quot;/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'&amp;quot;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	str <span style="color: #339933;">=</span> str.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/\¦/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'&amp;brvbar;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">return</span> str<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;postdivrich&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;codebox&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;?</span>php
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'dbx_post_sidebar'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'codebox_init'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://fatkun.com/2012/01/wp-syntax-code-editor.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fatkun图片批量下载谷歌浏览器扩展0.5版更新了</title>
		<link>http://fatkun.com/2011/12/batch-image-download-0-5.html</link>
		<comments>http://fatkun.com/2011/12/batch-image-download-0-5.html#comments</comments>
		<pubDate>Thu, 15 Dec 2011 15:45:21 +0000</pubDate>
		<dc:creator>fatkun</dc:creator>
				<category><![CDATA[网页前端]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[图片批量下载]]></category>
		<category><![CDATA[谷歌浏览器扩展]]></category>

		<guid isPermaLink="false">http://fatkun.com/?p=967</guid>
		<description><![CDATA[0.5版插件地址：https://bath-image-download.googlecode.com/files/batch0_5.crx &#160; 主要是修复性更新。。最近都感觉很累，晚上回来就不想做什么了~很久没更新博客了。 0.5版更新 修复CHROMEV15点击图片不删除的问题 图片居中显示 更多信息围观Fatkun图片批量下载谷歌浏览器扩展（Chrome Extensions）(0.5版)]]></description>
			<content:encoded><![CDATA[<p><strong>0.5版插件地址：<a href="http://bath-image-download.googlecode.com/files/batch0_5.crx" target="_blank">https://bath-image-download.googlecode.com/files/batch0_5.crx</a></strong></p>
<p>&nbsp;</p>
<p>主要是修复性更新。。最近都感觉很累，晚上回来就不想做什么了~很久没更新博客了。</p>
<p><strong>0.5版<strong>更新</strong></strong></p>
<ol>
<li>修复CHROMEV15点击图片不删除的问题</li>
<li>图片居中显示</li>
</ol>
<div>更多信息围观<a title="Fatkun图片批量下载谷歌浏览器扩展（Chrome Extensions）(0.5版)" href="http://fatkun.com/2010/09/batch-image-download.html">Fatkun图片批量下载谷歌浏览器扩展（Chrome Extensions）(0.5版)</a></div>
]]></content:encoded>
			<wfw:commentRss>http://fatkun.com/2011/12/batch-image-download-0-5.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

