SuperbookKing

2012年7月30日

13.系统级别事件处理之广播broadcast

摘要: myactivityintent.setAction(ACTION);sendBroadcast(intent);//////////////xml注册<receiver android:name=".service.MyReceiver" android:label="@string/app_name"> <intent-filter ><action android:name="android.provider.Telephony.SMS_RECEIVED"/></intent-filte 阅读全文

posted @ 2012-07-30 21:16 SuperbookKing 阅读(171) 评论(0) 推荐(0)
12.状态栏通知之notification

摘要: notificationtry{ Log.i(TAG, "service 线程文件下载:"+Thread.currentThread().getId()); showNotification(false); Thread.sleep(10000);} catch (InterruptedException e){ // TODO Auto-generated catch block e.printStackTrace();}showNotification(true);//////////////////////////////private void showNotifi 阅读全文

posted @ 2012-07-30 18:37 SuperbookKing 阅读(162) 评论(0) 推荐(0)
11.后台执行之Service

摘要: AServiceis an application component that can perform long-running operations in the background and does not provide a user interface.Service 后台长时间执行的控件service 声明:<service android:name=".service.ExampleSercice"/>1Started 调用者与服务者没关系oncreate->onstartCommand ->ondestroy2Bound调用者与服务 阅读全文

posted @ 2012-07-30 17:32 SuperbookKing 阅读(222) 评论(0) 推荐(0)

2012年7月29日

10.消息传递之Intent

摘要: Three of the core components of an application — activities, services, and broadcast receivers — are activated through messages, calledintents.Intent 一次对即将执行的操作的抽象描述1 Action 之 打电话发短信(注意添加打电话发短信权限<uses-permission android:name="android.permission.CALL_PHONE" /><uses-permission andro 阅读全文

posted @ 2012-07-29 21:46 SuperbookKing 阅读(182) 评论(0) 推荐(0)
9.用户接口UI布局----View控件的概述之ViewGroup

摘要: 1.LinearLayout 线性布局(主要分为水平和垂直线性布局)android:layout_width="fill_parent"android:layout_height="fill_parent"fill_parent会使得android:layout_weight="1" 分配的比重均衡android:gravity 表示子控件对齐方式或是内容文本的对齐方式// horizontal表示垂直线性布局 <LinearLayout xmlns:android="http://schemas.android.co 阅读全文

posted @ 2012-07-29 20:34 SuperbookKing 阅读(216) 评论(0) 推荐(0)

2012年7月23日

8.用户接口UI布局----View控件的概述之Pickers及pickers的Dialog控件

摘要: 1.DatePicker 日期控件java.lang.Objectandroid.view.Viewandroid.view.ViewGroupandroid.widget.FrameLayoutandroid.widget.DatePicker//Layout/main.xml<DatePicker android:id="@+id/dp" android:layout_width="fill_parent" android:layout_height="wrap_content" />//MyActivity.java 阅读全文

posted @ 2012-07-23 14:33 SuperbookKing 阅读(181) 评论(0) 推荐(0)
7.用户接口UI布局----View控件的概述之Spinner

摘要: Spinner 实现下拉选择java.lang.Object ↳ android.view.View ↳ android.view.ViewGroup ↳ android.widget.AdapterView<T extends android.widget.Adapter> ↳ android.widget.AbsSpinner↳android.widget.Spinner// Layout/main.xml<Spinner android:id="@+id/planets_spinner" android:layout_width="wr.. 阅读全文

posted @ 2012-07-23 11:38 SuperbookKing 阅读(151) 评论(0) 推荐(0)

2012年7月21日

6.用户接口UI布局----View控件的概述之RadioButton和CheckBox

摘要: 1.RadioButton(Button->CompoundButton子类)<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:layout_weight="1"> &l 阅读全文

posted @ 2012-07-21 22:00 SuperbookKing 阅读(218) 评论(0) 推荐(0)
5.用户接口UI布局----View控件的概述之Button

摘要: Button(textview 子类)----控件能向用户展现文本信息// With text<Button android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="@string/button_text" ... />// Withan icon ( ImageView 子类)<ImageButtonandroid:layout_width="wrap_content"android 阅读全文

posted @ 2012-07-21 19:43 SuperbookKing 阅读(155) 评论(0) 推荐(0)
4.用户接口UI布局----View控件的概述之EditText

摘要: 1.EditText(textview 子类)----控件能向用户展现文本信息//在XML布局文件中使用android:singleLine="false" 设置多行android:maxLength="3"限制输入字符数量android:hint="@string/hello"设置提示信息android:inputType="phone"限制EditText输入信息android:drawableLeft="@drawable/title"在EditText中显示图片android:backg 阅读全文

posted @ 2012-07-21 14:52 SuperbookKing 阅读(317) 评论(0) 推荐(0)