摘要: 第一种:继承TabActivity,从TabActivity中用getTabHost()方法获取TabHost。只要定义具体Tab内容布局就行了.xml布局:<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:id="@+id/wi 阅读全文
posted @ 2012-05-22 10:34 坏混混 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 1. 安装JDK ubuntu 11.04系统自带的Java环境是openjdk,最好使用sunjdk(具体原因不明,网上教程基本都是这样的),因此先去官方网站( http://www.oracle.com/technetwork/java/javase/downloads/index.html)下载“ Java SE 6 Update 26 ”的JDK安装包:Linux x86 - Self Extracting Installer (81.20 MB) jdk-6u26-linux-i586.bin1.1. 下载好后开始安装JDK,在终端里输入:cd Downloads/sudo cp . 阅读全文
posted @ 2012-05-21 16:55 坏混混 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 在android开发中ListView是比较常用的组件,它以列表的形式展示具体内容,并且能够根据数据的长度自适应显示。抽空把对ListView的使用做了整理,并写了个小例子,如下图列表的显示需要三个元素:1.ListVeiw 用来展示列表的View。2.适配器 用来把数据映射到ListView上的中介。3.数据 具体的将被映射的字符串,图片,或者基本组件。根据列表的适配器类型,列表分为三种,ArrayAdapter,SimpleAdapter和SimpleCursorAdapter其中以ArrayAdapter最为简单,只能展示一行字。SimpleAdapter有最好的扩充性,可以自定义出各种 阅读全文
posted @ 2012-05-19 10:15 坏混混 阅读(118) 评论(0) 推荐(0) 编辑
摘要: android 中所有的控件都是继承view,如果你认为你有能力,你可以修改framework,你可以把任何控件嵌入到别的控件中。1.第一你要创建一个线性布局,水平的,一个textview,一个button.我直接上源码:public class TestItemView extends LinearLayout {Context context;private TextView text;private Button btn;private LayoutParams a ;Drawable getIcon(int resource) {return getResources().getDra 阅读全文
posted @ 2012-05-18 22:11 坏混混 阅读(1631) 评论(0) 推荐(0) 编辑
摘要: Android应用程序在使用很多功能的时候必须在Mainifest.xml中声明所需的权限,否则无法运行。Android中为应用程序准备了很多可选权限,下面是Android应用程序权限清单: android.permission.ACCESS_CHECKIN_PROPERTIES :Allows read/write access to the “properties” table in the checkin database, to change values that get uploaded.允许以read/write访问检入数据库(checkin database?)的"p 阅读全文
posted @ 2012-05-18 16:16 坏混混 阅读(467) 评论(0) 推荐(0) 编辑