Android成长日记-ListView】的更多相关文章

数据适配器:把复杂的数据(数组,链表,数据库,集合等)填充在指定的视图界面上 适配器的类型: ① ArrayAdapter(数组适配器):用于绑定格式单一的数据 数据源:可以是集合或数组 ① SimpleAdapter(简单适配器):用于绑定格式复杂的数据 数据源:只能是特定泛型的集合 -à>>数据适配器是连接数据源和视图界面的桥梁 à实现过程:新建适配器->添加数据源到适配器->视图加载适配器 Ps: 监听器 1. onItemClickListener:可以处理视图中单个条目的…
本节将实现以下效果 Ps:看起来很不错的样子吧,而且很像九宫格/se ----------------------------------------------------------------------- 下面进入正题[s1] : Step 1:新建Layout,里面创建GridView <GridView android:id="@+id/gridView" android:layout_width="wrap_content" android:la…
1.什么是Service? Service是Android四大组件中与Activity最相似的组件,它们都代表可执行的程序,Service与Activity的区别在于:Service一直在后台运行,它没有用户界面,所以绝不会到前台来.一旦Service被启动起来,它就与Activity一样.它完全具有自己的生命周期. A Service is an application component that can perform long-running operations in the back…
[SQLite简介] SQLite是R.Richard Hipp用C语言编写的开源嵌入式数据库引擎.它支持大多数的SQL92标准,并且可以在所有主要的操作系统上运行 ---支持高达2TB大小的数据库:以单个文件的形式存在:以B-Tree的数据结构形式存储在磁盘 [特点] 1.轻量级   一个动态库.单文件 2.独立性   没有依赖.无需安装 3.隔离性   全部在一个文件夹中 4.跨平台   支持众多操作系统 5.多语言接口     支持众多编程语言 6.安全性    事务 ps:(关于事务处理…
1. 五布局之线性布局LinearLayout 特点:它包含的子控件将以横向或竖向的方式排列 ps:android:gravity=”center|bottom”(gravity允许多级联用) Tip:注意以下例子: <Button Android:layout_weight=”2” Android:layout_height=”wrap_parent” Android:layout_width=”match_parent”/> <Button Android:layout_weight…
数据篇-SharedPreferences Android的四种存储方式 1. SharedPreferences 2. SQLite 3. Content Provider 4. File ------------------------------华丽分割线---------------------------- SharedPreference: 1. 是一种轻型的数据存储方式 2. 本质是基于XML文件存储Key-Value键值对数据 3. 通常用来存储一些简单的配置信息 -------…
(一) ViewFlipper介绍 Android系统自带的一个多页面管理控件,它可以实现子界面的自动切换 (二) 为ViewFlipper加入View 1. 静态导入:在Layout布局文件中直接导入(不推荐*不灵活) 2. 动态导入:addView()方法 Eg:flipper=(ViewFipper)findViewById(R.id.flipper); Flipper.addView(getImageView(R.drawable.pic)) (三) ViewFlipper的常用方法 a…
案例演示 此案例实现思路:通过ToggleButton控件,ImageView控件实现 ---xml代码: <!-- textOn:true textOff:falase[s1] --> <ToggleButton android:id="@+id/toggleB utton1" android:layout_width="match_parent" android:layout_height="wrap_content" an…
Tip:此方式可以实现页面切换 1. 创建view1.xml,view2.xml,view3.xml,main.xml 在main.xml中创建 <android.support.v4.view.ViewPager android:id="@+id/pager" android:layout_width="wrap_content" android:layout_height="wrap_content"> </android.…
Intent:可以理解为信使(意图),由Intent来协助完成Android各个组件之间的通讯 Intent实现页面之间的跳转 1->startActivity(intent) 2->startActivityForResult(intent,requestCode); onActivityForResult(int requestCode,int resultCode, Intent data) setResult(resultCode,data) 1. 无返回结果的页面跳转 a) 主要通过…