zoukankan      html  css  js  c++  java
  • 按Notification 回到正在运行的activity

      写好Notification , 按Home回到主界面,再按通知栏的消息(Notification), 回到退出之前正在运行的Acticity .

        在代码中加入两行代码作为声名即可。 :

                     
                     Intent notificationIntent = new Intent(this,this.getClass()); 

                    /* */
                    notificationIntent.setAction(Intent.ACTION_MAIN);
                    notificationIntent.addCategory(Intent.CATEGORY_LAUNCHER);
                     

                    PendingIntent contentIntent = PendingIntent.getActivity(this.context, 0, notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT);
                    notification.setLatestEventInfo(context, title, text, contentIntent);        
                    mNotificationManager.notify(NOTIFICATION_SERVICE_ID,notification);

  • 相关阅读:
    JQuery UI
    JQuery 插件
    JQuery Ajax
    varchar和Nvarchar区别
    git冲突解决
    jquery ajax 提交信息后等待返回的提示信息
    Oracle错误 ORA-12560如何解决
    putty ssh连接老断
    myeclipse操作记录
    HTML与HTML5笔记
  • 原文地址:https://www.cnblogs.com/xilinch/p/2749593.html
Copyright © 2011-2022 走看看