然后在通知中,设置单击时要调用的Activity的名称,如下所示:
notificationmanager notificationmanager = (notificationmanager) getSystemService(NOTIFICATION_SERVICE); Notification notification = new Notification(R.drawable.icon,"A new notification",System.currentTimeMillis());// Specify the called ActivityIntent intent = new Intent(this,YourActivityname.class);intent.putBoolean("isDownloading",true); // check this value in ActivityPendingIntent activity = PendingIntent.getActivity(this,intent,0);notification.setLatestEventInfo(this,"This is the Title","This is the text",activity);notificationmanager.notify(0,notification);总结
以上是内存溢出为你收集整理的android – 如何隐藏活动?全部内容,希望文章能够帮你解决android – 如何隐藏活动?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)