DASOU

导航

06 2013 档案

Serivce服务
摘要:Service与Activity基本相似的,他们的区别在于Activity主要是在前台运行,而Service是在后台运行,并不提供界面。开发步骤:定义一个继承Service的子类在AndroidMainifest.xml文件中进行配置Service的启动或停止服务有3种方式:启动停止区别context.startService()context.stopService()组件退出,服务不退出,服务在系统中Service.stopSelf()Service.stopSelfResult()Context.bindService()context.unbindService()组件退出,服务也退出 阅读全文

posted @ 2013-06-25 22:40 DASOU 阅读(530) 评论(0) 推荐(0) 编辑

Intent之调用系统组件
摘要:1、调用web浏览器1 Uri uri=Uri.parse("www.baidu.com");2 Intent intent=new Intent(Intent.ACTION_VIEW,uri);3 startActivity(intent);2、显示地图1 Uri uri=Uri.parse("geo:118.797694,32");2 Intent intent=new Intent(Intent.ACTION_VIEW,uri);3 startActivity(intent);3、调用拨号界面1 Uri uri=Uri.parse("te 阅读全文

posted @ 2013-06-21 22:40 DASOU 阅读(282) 评论(0) 推荐(0) 编辑

Intent 意图
摘要:功能:intent主要是用于在activity和service组件间进行数据的传递,起着一个中间桥梁的通信作用类型主要分为1、显式intent:来启动指定的组件如从一个activity跳转到另外的activity并传递数据,1 Intent intent=new Intent(Activitymain.this,Activity01.class);2 startActivity(intent); 也可以用setClass(Context,Class)来指定目标组件1 Intent intent=new Intent();2 intent.setClass(this,Activity01.cl. 阅读全文

posted @ 2013-06-21 21:34 DASOU 阅读(262) 评论(0) 推荐(0) 编辑

广播接收器的类别
摘要:广播接收器主要分为:普通广播,有序广播,异步广播一、普通广播:所有监听该广播的BroadcastReceiver都能接收到该广播,无法控制广播的顺序,也无法打断广播的传播 sendBroadcast(Intent intent);//发送普通广播二、有序广播:按照级别值来确定先后顺序,同级别随机,级别值在-1000~1000 如何发送有序广播: 1,先在配置文件中对优先级别进行设置...2 </activity>3 4 <receiver android:name=".MyBroadcastReceiver">5 <intent-filter 阅读全文

posted @ 2013-06-21 11:38 DASOU 阅读(376) 评论(0) 推荐(0) 编辑

BroadcastReceiver(广播接收器)
摘要:广播接收器主要是不同的应用程序和组件之间的通信机制实现步骤:广播周期的生命周期1.广播的注册:1 IntentFilter intentFilter=new IntentFilter();//创建一个IntentFilter对象2 intentFilter.addAction("com.android.myAction");//为BroadcastReceiver指定action,用于接收同action的广播4 mBroadcastReceiver=new myBroadcastReceiver();//创建一个广播接收器6 registerRec... 阅读全文

posted @ 2013-06-18 08:45 DASOU 阅读(278) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示