2014年2月18日

IntentService 新建线程的证明

摘要: 在Activity中,startService()创建IntentService的时候,通过打印线程id,得知当前线程是1// long id = Thread.currentThread().getId(); 在IntentService的默认构造函数中,打印线程id 仍然为1 在onHandleIntent()中打印id,发现id为96,说明在onHandleIntent()处理事件的时候,系统会自动开辟新的线程去处理,这就是IntentService的用处, All requests are handled on a single worker thread -- the... 阅读全文

posted @ 2014-02-18 17:53 小白说我是2B 阅读(352) 评论(0) 推荐(0) 编辑

BroadCastRecevier使用

摘要: 1.创建一个Intent ,发送出去1 Intent intent =new Intent();2 intent.setAction("123");3 intent.putExtra("msg","简单的消息");4 sendBroadcast(intent); 2.在manifes.xml中声明receiver 1 3 4 5 >6 ... 阅读全文

posted @ 2014-02-18 17:44 小白说我是2B 阅读(244) 评论(0) 推荐(0) 编辑

高德定位Sdk 使用sample

摘要: 1.LocationManagerProxy 获取当前Context 创建一个LocationManagerProxy 变量 mAMapLocManager = LocationManagerProxy.getInstance(this); 2.mAMapLocManager.requestLocationUpdates(LocationProviderProxy.AMapNetwork, 5000, 10, this); //设定 精度 5000m 监听器为当前Activity 所以当前Activiy需要继承AMapLocation... 阅读全文

posted @ 2014-02-18 10:10 小白说我是2B 阅读(896) 评论(0) 推荐(0) 编辑

导航