当前位置: 首页 > news >正文

网站备案的幕布尺寸贵州建设厅施工员考试网站

网站备案的幕布尺寸,贵州建设厅施工员考试网站,十大网游人气排行榜,无锡网站建设系统原文地址#xff1a;http://android.xsoftlab.net/training/notify-user/navigation.html 设计通知时要考虑到用户所预想的导航体验。通常有以下两种情况#xff1a; 常规的Activity(Regular activity) 这里所启动的Activity是作为应用程序的正常流程部分出现的。 指定的…原文地址http://android.xsoftlab.net/training/notify-user/navigation.html 设计通知时要考虑到用户所预想的导航体验。通常有以下两种情况 常规的Activity(Regular activity) 这里所启动的Activity是作为应用程序的正常流程部分出现的。 指定的Activity(Special activity) 用户只会看到这个Activity如果这个Activity是从通知启动的话。在直觉上这个Activity是用来展示通知上的详细信息的。 设置常规的Activity 设置启动常规的Activity需要执行以下步骤 1.在清单文件中定义Activity的层级最终的清单文件应该是这样的 activityandroid:name.MainActivityandroid:labelstring/app_name intent-filteraction android:nameandroid.intent.action.MAIN /category android:nameandroid.intent.category.LAUNCHER //intent-filter /activity activityandroid:name.ResultActivityandroid:parentActivityName.MainActivitymeta-dataandroid:nameandroid.support.PARENT_ACTIVITYandroid:value.MainActivity/ /activity 2.创建一个基于回退栈的Intent它用来启动父Activity(下面的代码可能有误请自行验证。) int id 1; ... Intent resultIntent new Intent(this, ResultActivity.class); TaskStackBuilder stackBuilder TaskStackBuilder.create(this); // Adds the back stack stackBuilder.addParentStack(ResultActivity.class); // Adds the Intent to the top of the stack stackBuilder.addNextIntent(resultIntent); // Gets a PendingIntent containing the entire back stack PendingIntent resultPendingIntent stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT); ... NotificationCompat.Builder builder new NotificationCompat.Builder(this); builder.setContentIntent(resultPendingIntent); NotificationManager mNotificationManager (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); mNotificationManager.notify(id, builder.build()); 设置启动指定的Activity 启动指定的Activity不需要回退栈所以不需要在清单文件中定义Activity的层级也不需要在代码中使用addParentStack()构建回退栈。相反的使用清单文件来设置Activity的任务模式并通过getActivity()创建PendingIntent就可以完成创建。 1.在清单文件中为Activity添加如下属性 android:name”activityclass” 指定该Activity的全限定名称.android:taskAffinity”” 与在代码中设置的FLAG_ACTIVITY_NEW_TASK标志一同使用。这可以确保这个Activity不会进入应用程序的默认任务栈中。任何已有的任务栈皆不会受到这个属性的影响。android:excludeFromRecents”true” 将该Activity从Recents中排除所以用户不会意外的再通过返回键启动这个Activity. 下面的代码段展示了这个属性的设置 activityandroid:name.ResultActivity ...android:launchModesingleTaskandroid:taskAffinityandroid:excludeFromRecentstrue /activity ... 2.构建及发射通知 a.创建一个用于启动Activity的Intent.b.通过调用setFlags()方法并设置FLAG_ACTIVITY_NEW_TASK和FLAG_ACTIVITY_CLEAR_TASK标志来设置Activity将要启动一个新的、空的任务栈.c.为Intent设置你所需要的选项.d.通过调用getActivity()由Intent创建一个PendingIntent。你可以将这个PendingIntent作为setContentIntent()方法的参数。 下面的代码段演示了这个实现过程 // Instantiate a Builder object. NotificationCompat.Builder builder new NotificationCompat.Builder(this); // Creates an Intent for the Activity Intent notifyIntent new Intent(new ComponentName(this, ResultActivity.class)); // Sets the Activity to start in a new, empty task notifyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); // Creates the PendingIntent PendingIntent notifyIntent PendingIntent.getActivity(this,0,notifyIntent,PendingIntent.FLAG_UPDATE_CURRENT ); // Puts the PendingIntent into the notification builder builder.setContentIntent(notifyIntent); // Notifications are issued by sending them to the // NotificationManager system service. NotificationManager mNotificationManager (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); // Builds an anonymous Notification object from the builder, and // passes it to the NotificationManager mNotificationManager.notify(id, builder.build());
http://www.pierceye.com/news/29396/

相关文章:

  • 苏州网站建设的公司哪家好济南 网站推广
  • 游戏网站交换友情链接网上可以自学什么技术
  • 淮安哪里有做网站的人网站标题字数
  • 电子商务网站开发设计报告书物流网站 源码
  • 从哪个网站找钢做的微商wordpress 必装插件
  • 云南省住房和城乡建设厅官方网站wordpress 仪表盘很慢
  • 外贸自建站收款通道广州seo培训课程
  • 虚拟主机部署网站网代理加盟
  • 网站头部修改淘宝客不建立网站怎么做
  • 奇艺广州网站建设熊掌号番禺网站建设企业
  • 对网站建设过程游戏页面设计模板
  • 称多网站建设河南省教育厅官方网站师德建设
  • 龙岗高端网站建设小程序可做网站吗
  • 网站链接太多怎么做网站地图国家城乡住房建设厅网站
  • 特产网站源码扬中人才
  • 外贸网站建设制作专门做招商的网站是什么
  • 云服务器开网站猪八戒网可以做福彩网站吗
  • 怎么查询网站的备案号苏宁易购的网站建设
  • 温州平阳县网站建设兼职山东官方网站栖霞市观里镇少城镇建设规划
  • 大学生兼职网网站建设计划书常州做网站信息
  • 微信公众号 做不了微网站洛阳网站设计
  • 青岛美容化妆品外贸网站建设四川手机网站有哪些
  • 什么公司需要建立网站吗购买一个域名能建几个网站
  • 医院 网站建设 中企动力无锡网站制作难吗
  • 河北网站优化wordpress 海报风格
  • 如何用本地视频做网站x浏览器
  • 男女在床上做暖暖插孔网站wordpress4.3.1下载
  • 网站设计之路手机如何制作一个网页链接
  • 专业网站优化案例宁波网络营销策划公司
  • 微网站做下载链接好的wordpress企业模板下载地址