<?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>Bluewing&#039;s Blog</title>
	<atom:link href="http://43431.cn/index.php" rel="self" type="application/rss+xml" />
	<link>http://43431.cn</link>
	<description>我的开发博客空间</description>
	<lastBuildDate>Fri, 02 Apr 2010 09:39:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Intent研究</title>
		<link>http://43431.cn/?p=25</link>
		<comments>http://43431.cn/?p=25#comments</comments>
		<pubDate>Fri, 02 Apr 2010 09:37:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Intent]]></category>

		<guid isPermaLink="false">http://43431.cn/?p=25</guid>
		<description><![CDATA[//创建实例
Intent i = new Intent();
//设置启动对象
i.setClass(A.Class,B.Class);
//以下方法可选
startActivity(i);//直接启动
startActivityForResult(i,123);//返回启动
A.Class
需要添加返回事件onActivityResult，data.getExtras().getString("back");
获取对象(myclass = (MyClass)intent.getSerializableExtra("myclass");)
B.Class
Intent i = new Intent();
i.putExtra("back","返回的字符串");
setResult(456,i);
finish();
]]></description>
			<content:encoded><![CDATA[<blockquote><p><code>//创建实例<br />
Intent i = new Intent();<br />
//设置启动对象<br />
i.setClass(A.Class,B.Class);<br />
//以下方法可选<br />
<span style="color: #ff6600;">startActivity(i);//直接启动<br />
</span><span style="color: #99cc00;">startActivityForResult(i,123);//返回启动</span><br />
A.Class<br />
需要添加返回事件onActivityResult，data.getExtras().getString("back");<br />
获取对象(myclass = (MyClass)intent.getSerializableExtra("myclass");)<br />
B.Class<br />
Intent i = new Intent();<br />
i.putExtra("back","返回的字符串");<br />
setResult(456,i);<br />
finish();</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://43431.cn/?feed=rss2&amp;p=25</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android UI Layout 之 AbsoluteLayout</title>
		<link>http://43431.cn/?p=15</link>
		<comments>http://43431.cn/?p=15#comments</comments>
		<pubDate>Fri, 22 Jan 2010 09:49:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://43431.cn/?p=15</guid>
		<description><![CDATA[在Android UI中，最基本的构建单位（building block）是 android.view.View。一个 View 占据屏幕上的一个矩形区域，并负责该区域的绘画和事件处理。View 有一些子类，比如 ImageView、TextView 等可分别用来显示图像、文字…… View 还有一个特殊的子类 ViewGroup，ViewGroup 在 UI layout 中充当“容器”的角色，用以“包含”其他 View 以及 ViewGroup：
由于 ViewGroup 是一个 abstract class 无法直接实例化，所以在 layout 中真正充当“容器”角色的应该是 ViewGroup 的子类 ：AbsoluteLayout、 FrameLayout、 LinearLayout、 RelativeLayout 等。在实际的 UI 编程中，使用不同的 Layout 类作为容器，对该容器中的各个子 View 的排列方式有很大影响。比如，LinearLayout 中的各个子 View 按照横向或者纵向线性排列；而 AbsoluteLayout 中各个子 View 可以指定以像素为单位的“绝对”位置。AbsoluteLayout 的这种“绝对”定位的布局方式和我们非常熟悉的 Windows 编程中的 SetWindowPos() 或 Form1.Left = 10 的布局方式是一样的，比较简单：
现在我们新建一个 [...]]]></description>
			<content:encoded><![CDATA[<p>在Android UI中，最基本的构建单位（building block）是 android.view.View。一个 View 占据屏幕上的一个矩形区域，并负责该区域的绘画和事件处理。View 有一些子类，比如 ImageView、TextView 等可分别用来显示图像、文字…… View 还有一个特殊的子类 ViewGroup，ViewGroup 在 UI layout 中充当“容器”的角色，用以“包含”其他 View 以及 ViewGroup：</p>
<p>由于 ViewGroup 是一个 abstract class 无法直接实例化，所以在 layout 中真正充当“容器”角色的应该是 ViewGroup 的子类 ：AbsoluteLayout、 FrameLayout、 LinearLayout、 RelativeLayout 等。在实际的 UI 编程中，使用不同的 Layout 类作为容器，对该容器中的各个子 View 的排列方式有很大影响。比如，LinearLayout 中的各个子 View 按照横向或者纵向线性排列；而 AbsoluteLayout 中各个子 View 可以指定以像素为单位的“绝对”位置。AbsoluteLayout 的这种“绝对”定位的布局方式和我们非常熟悉的 Windows 编程中的 SetWindowPos() 或 Form1.Left = 10 的布局方式是一样的，比较简单：<br />
现在我们新建一个 Android 工程中，在其主 Activity 类中添加如下三个成员：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> AbsoluteLayout al<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">private</span> TextView tv<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">View</span> v<span style="color: #339933;">;</span></pre></td></tr></table></div>

<p><code>private AbsoluteLayout al;<br />
private TextView tv;<br />
private View v;</code><br />
改写这个类的 onCreate 方法如下：<br />
<code>public void onCreate(Bundle icicle) {<br />
super.onCreate(icicle);</code></p>
<p>// 构造一个 AbsoluteLayout，设置其背景色<br />
al = new AbsoluteLayout(this);<br />
al.setBackgroundColor(Color.YELLOW);<br />
// 构造一个 TextView 并设置其 text 和 背景色<br />
tv = new TextView(this);<br />
tv.setText(&#8220;Android is a software stack for mobile devices that includes an operating system, middleware and key applications. &#8220;);<br />
tv.setBackgroundColor(Color.BLUE);<br />
// 用该 View 在父 View 中的 width，height，x，y 作为参数构造一个 AbsoluteLayout.LayoutParams<br />
AbsoluteLayout.LayoutParams tvLP = new AbsoluteLayout.LayoutParams(70, 50, 10, 20);<br />
// 把这个 TextView 加入到 AbsoluteLayout 中，并应用上一步创建的 LayoutParams。这样 TextView 就会显示在我们指定的位置上了。<br />
al.addView(tv, tvLP);</p>
<p>v = new View(this);<br />
v.setBackgroundColor(Color.RED);<br />
AbsoluteLayout.LayoutParams vLP = new AbsoluteLayout.LayoutParams(70, 50, 90, 70);<br />
// 也可以先为子 View 设置 LayoutParams，然后再调用一个参数的 ViewGroup.addView(View) 来添加。效果是一样的。<br />
v.setLayoutParams(vLP);<br />
al.addView(v);</p>
<p>// 设置 al 为本 Activity 的 content<br />
// 这样，在该 Activity 被调用时，就会显示该 AbsoluteLayout 和其子 View<br />
this.setContentView(al);<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://43431.cn/?feed=rss2&amp;p=15</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#25163;&#26426;&#21457;&#21338;&#23458;</title>
		<link>http://43431.cn/?p=14</link>
		<comments>http://43431.cn/?p=14#comments</comments>
		<pubDate>Fri, 22 Jan 2010 08:42:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[手机]]></category>

		<guid isPermaLink="false">http://43431.cn/?p=14</guid>
		<description><![CDATA[
&#30475;&#30475;
]]></description>
			<content:encoded><![CDATA[<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://43431.cn/wp-content/uploads/2010/01/wpid-100112-194426.jpg" /></p>
<p><strong>&#30475;&#30475;</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://43431.cn/?feed=rss2&amp;p=14</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>android布局学习利器-Hierarchy Viewer</title>
		<link>http://43431.cn/?p=11</link>
		<comments>http://43431.cn/?p=11#comments</comments>
		<pubDate>Fri, 22 Jan 2010 03:58:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://43431.cn/?p=11</guid>
		<description><![CDATA[Hierarchy Viewer 帮你分析应用程序UI布局
Hierarchy Viewer在android的工具文件夹里： \android\tools\hierarchyviewer.bat
1.启动 模拟器。
2.到\android\tools\目录下，双击可以启动hierarchyviewerbat文件，打开一个图形界面。
3.点击 load View hierarchy按钮，就可以捕获模拟器当前activity的画面布局信息。
4.hierarchy通过树形结构展示布局形式。
5.双击树节点可以展示单独的UI部分。
6.当模拟器activity画面变更后，点击refresh可以加载新的页面布局信息。
通过Hierarchy Viewer你就可以学习别人优秀的布局方式，
同时也更能更深入更全面更整体的把握xml布局文件。
体会UI和代码（java code）以及资源（res）的相互分离。
]]></description>
			<content:encoded><![CDATA[<p>Hierarchy Viewer 帮你分析应用程序UI布局</p>
<p>Hierarchy Viewer在android的工具文件夹里： \android\tools\hierarchyviewer.bat</p>
<p>1.启动 模拟器。</p>
<p>2.到\android\tools\目录下，双击可以启动hierarchyviewerbat文件，打开一个图形界面。</p>
<p>3.点击 load View hierarchy按钮，就可以捕获模拟器当前activity的画面布局信息。</p>
<p>4.hierarchy通过树形结构展示布局形式。</p>
<p>5.双击树节点可以展示单独的UI部分。</p>
<p>6.当模拟器activity画面变更后，点击refresh可以加载新的页面布局信息。</p>
<p>通过Hierarchy Viewer你就可以学习别人优秀的布局方式，<br />
同时也更能更深入更全面更整体的把握xml布局文件。<br />
体会UI和代码（java code）以及资源（res）的相互分离。</p>
]]></content:encoded>
			<wfw:commentRss>http://43431.cn/?feed=rss2&amp;p=11</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eclipse显示行数</title>
		<link>http://43431.cn/?p=8</link>
		<comments>http://43431.cn/?p=8#comments</comments>
		<pubDate>Fri, 22 Jan 2010 03:25:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">http://43431.cn/?p=8</guid>
		<description><![CDATA[Window-Preferences-General-Editors-Text Editor :show line numbers;
]]></description>
			<content:encoded><![CDATA[<p>Window-Preferences-General-Editors-Text Editor :show line numbers;</p>
]]></content:encoded>
			<wfw:commentRss>http://43431.cn/?feed=rss2&amp;p=8</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Layouts</title>
		<link>http://43431.cn/?p=4</link>
		<comments>http://43431.cn/?p=4#comments</comments>
		<pubDate>Wed, 20 Jan 2010 04:39:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://43431.cn/?p=4</guid>
		<description><![CDATA[Layout资源是通过在XML中设计UI布局来作为显示层的内容，而不是在代码中去构建它们。
 
Layout最常用的用途是为Activity定义UI。一旦在XML中定义，一般就在Activity的onCreate方法中通过setContentView进行显示。
 
你同样可以引用其它的layout资源，例如为ListView的每一行设定layout。更多的关于在Activity中使用和创建layout的信息你可以在第4章中看到。
 
在Android中，使用layout来创建屏幕的UI是一个好的习惯。将代码和layout分离开来，有助于你为不同的硬件配置（例如，变化的屏幕大小，方向或者键盘和触摸屏的显示）创建最优的layout。
 
每一个layout定义在/res/layout文件夹下的独立的文件里，包含单个layout。文件名就是layout资源的标识。
 
关于layout面板和View元素的详尽解释会在下一章。但作为一个例子，下面的代码片段显示了新工程向导创建的layout。它使用LinearLayout作为一个layout面板，容纳显示“Hello World”问候的TextView。
&#60;?xml version=”1.0” encoding=”utf-8”?&#62;
&#60;LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”
android:orientation=”vertical”
android:layout_width=”fill_parent”
android:layout_height=”fill_parent”&#62;
&#60;TextView
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:text=”Hello World!”
/&#62;
&#60;/LinearLayout&#62;
]]></description>
			<content:encoded><![CDATA[<p>Layout资源是通过在XML中设计UI布局来作为显示层的内容，而不是在代码中去构建它们。</p>
<p lang="zh-CN"> </p>
<p>Layout最常用的用途是为Activity定义UI。一旦在XML中定义，一般就在Activity的onCreate方法中通过setContentView进行显示。</p>
<p lang="zh-CN"> </p>
<p>你同样可以引用其它的layout资源，例如为ListView的每一行设定layout。更多的关于在Activity中使用和创建layout的信息你可以在第4章中看到。</p>
<p lang="zh-CN"> </p>
<p>在Android中，使用layout来创建屏幕的UI是一个好的习惯。将代码和layout分离开来，有助于你为不同的硬件配置（例如，变化的屏幕大小，方向或者键盘和触摸屏的显示）创建最优的layout。</p>
<p lang="zh-CN"> </p>
<p>每一个layout定义在/res/layout文件夹下的独立的文件里，包含单个layout。文件名就是layout资源的标识。</p>
<p lang="zh-CN"> </p>
<p>关于layout面板和View元素的详尽解释会在下一章。但作为一个例子，下面的代码片段显示了新工程向导创建的layout。它使用LinearLayout作为一个layout面板，容纳显示“Hello World”问候的TextView。</p>
<blockquote><p>&lt;?xml version=”1.0” encoding=”utf-8”?&gt;</p>
<p>&lt;LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”</p>
<p>android:orientation=”vertical”</p>
<p>android:layout_width=”fill_parent”</p>
<p>android:layout_height=”fill_parent”&gt;</p>
<p>&lt;TextView</p>
<p>android:layout_width=”fill_parent”</p>
<p>android:layout_height=”wrap_content”</p>
<p>android:text=”Hello World!”</p>
<p>/&gt;</p>
<p>&lt;/LinearLayout&gt;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://43431.cn/?feed=rss2&amp;p=4</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#25163;&#26426;&#21457;&#21338;&#23458;</title>
		<link>http://43431.cn/?p=3</link>
		<comments>http://43431.cn/?p=3#comments</comments>
		<pubDate>Wed, 20 Jan 2010 04:27:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[手机]]></category>

		<guid isPermaLink="false">http://43431.cn/?p=3</guid>
		<description><![CDATA[&#30475;&#30475;
]]></description>
			<content:encoded><![CDATA[<p><strong>&#30475;&#30475;</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://43431.cn/?feed=rss2&amp;p=3</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello world！</title>
		<link>http://43431.cn/?p=1</link>
		<comments>http://43431.cn/?p=1#comments</comments>
		<pubDate>Wed, 20 Jan 2010 03:56:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://43431.cn/?p=1</guid>
		<description><![CDATA[欢迎使用 WordPress 。这是系统自动生成的演示文章。编辑或者删除它，开始您的博客！
]]></description>
			<content:encoded><![CDATA[<p>欢迎使用 WordPress 。这是系统自动生成的演示文章。编辑或者删除它，开始您的博客！</p>
]]></content:encoded>
			<wfw:commentRss>http://43431.cn/?feed=rss2&amp;p=1</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
