01 2012 档案

摘要:两个 activity 中相互切换,使用 Intent 对像,使用很简单Intentin=newIntent();in.setClass(this,active2.class);//向active2传值in.putExtra("tt",et.getText().toString());this.startActivity(in);this.finish();详细代码main.xml 第一个 activity用的 xml<?xmlversion="1.0"encoding="utf-8"?><LinearLayoutx 阅读全文
posted @ 2012-01-13 16:16 zziss 阅读(425) 评论(2) 推荐(0) 编辑
摘要:android 中使用文件进行存储程序数据注意,读写 sdcard 时,需要用到权限,具体代码如下xml<?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent"android:orien 阅读全文
posted @ 2012-01-12 16:53 zziss 阅读(503) 评论(0) 推荐(0) 编辑
摘要:SharedPreferences 存储,这个常用于程序内的一些配置项的存储,使用比 symbian 要简单好多,代码很简单,测试时使用的是 String ,也可以使用其它的试试具体代码如下:xml<?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:lay 阅读全文
posted @ 2012-01-11 22:53 zziss 阅读(137) 评论(0) 推荐(0) 编辑
摘要:ImageSwitch 需要一个 ViewFactory 接口方法,返回一个 ImageView 对像,同时指定 setFactory 方法其中试了试用 ImageView 实现 ImageSwitcher ,并没有发现有什么不同,还有是其它什么不同呢?代码如下:xml<?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_widt 阅读全文
posted @ 2012-01-05 23:17 zziss 阅读(293) 评论(0) 推荐(0) 编辑
摘要:Gallery 是显示图片用的,需要指定一个图片的来源 adapter ,这个继承自 BaseAdapter ,具体代码如下xml 代码<?xmlversion="1.0"encoding="utf-8"?><Galleryxmlns:android="http://schemas.android.com/apk/res/android"android:id="@+id/gallery"android:layout_width="fill_parent"android:layo 阅读全文
posted @ 2012-01-05 16:24 zziss 阅读(265) 评论(0) 推荐(0) 编辑