摘要: 在Android系统中,发一个状态栏通知还是很方便的。下面我们就来看一下,怎么发送状态栏通知,状态栏通知又有哪些参数可以设置?首先,发送一个状态栏通知必须用到两个类: NotificationManager 、 Notification。NotificationManager : 是状态栏通知的管理类,负责发通知、清楚通知等。NotificationManager 是一个系统Service,必须通过 getSystemService()方法来获取。NotificationManager nm = (NotificationManager) getSystemService(NOTIFICA.. 阅读全文
posted @ 2013-03-26 16:59 与时俱进 阅读(1045) 评论(0) 推荐(0) 编辑
摘要: 第一步:首先创建一个广播接收者,重构其抽象方法 onReceive(Context context, Intent intent),在其中启动你想要启动的Service或app。 import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.util.Log; public class BootBroadcastReceiver extends BroadcastReceiver { //重写onReceive方法 @ 阅读全文
posted @ 2013-03-26 16:57 与时俱进 阅读(45079) 评论(2) 推荐(1) 编辑
友情链接:同里老宅院民居客栈