1. 动态注册与退出 If registering a receiver in yourActivity.onResume()implementation, you should unregister it inActivity.onPause(). (You won't receive inte... Read More
posted @ 2014-01-10 18:35 等风来。。 Views(471) Comments(0) Diggs(0)
1。无论是 Activity、BroadcastReceiver还是Service,只要是有长时间处理的任务,就需要重新开一个线程来处理,为什么会这样?因为他们都是运行在主线程中的。2。在使用BroadcastReceiver时,有一个我们需要注意的问题:在BroadcastReceiver的onReceive(Context context , Intent intent )这个context是Activity还是Application?如果你的BroadcastReceiver是通过在Activity中的registerReceiver(Broadcaster, filter)来注册的话, Read More
posted @ 2014-01-10 17:10 等风来。。 Views(310) Comments(0) Diggs(0)
PendingIntent是一个特殊的Intent,实际上它像一个邮包,其中包裹着真正的Intent,当邮包未打开时,Intent是被“挂起”的,所以并不执行,只有当邮包拆开时才会执行。它与Intent的区别在于:Intent 是及时启动,intent 随所在的activity 消失而消失。 PendingIntent 可以看作是对intent的包装,通过getActivity,getBroadcast ,getService来得到pendingintent的实例,当前activity并不能马上启动它所包含的 Intent, 而是在外部执行 pendingintent时再调用 In... Read More
posted @ 2014-01-10 16:53 等风来。。 Views(591) Comments(0) Diggs(0)
------------------------------------------------------------------------------------------------------------ --------------- 欢迎联系 x.guan.ling@gmail.com--------------- ------------------------------------------------------------------------------------------------------------