37、pendingIntent 点击通知栏进入页面
转载:
http://blog.csdn.net/yuzhiboyi/article/details/8484771
https://my.oschina.net/youranhongcha/blog/196933
new Thread() {
@Override
public void run() {
// TODO Auto-generated method stub
super.run();
NotificationManager manager = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
Notification notification = new Notification();
// 不会被清除
notification.flags = Notification.FLAG_NO_CLEAR;
notification.icon = R.drawable.main_icon_notification;
notification.tickerText = "XXX正在保护您的手机";
// 远程的view 我们的view对象 是要显示在另外一个进程里面 另外一个程序里面 所以就需要一个remote view
RemoteViews rv = new RemoteViews(getPackageName(),
R.layout.monitor_app);
rv.setTextViewText(R.id.textView1, "XXX正在保护您的手机");
rv.setProgressBar(R.id.progressBar1, 100, 0, false);
notification.contentView = rv;
Intent intent = new Intent(MonitorService.this,
SplashActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(
MonitorService.this, 0, intent,
Intent.FLAG_ACTIVITY_NEW_TASK);
notification.contentIntent = pendingIntent;
manager.notify(2, notification);
}
}.start();
37、pendingIntent 点击通知栏进入页面的更多相关文章
- iOS之点击通知栏跳转应用的相关页面
当远程推送通知到达应用,有3个相关的方法是用来处理这个通知的. - (BOOL)application:(UIApplication *)application didFinishLaunchingW ...
- Android实现点击通知栏后,先启动应用再打开目标Activity ,极光推送等推送的也可以参考一下(转)
我因为项目中集成了极光推送,推送的通知栏点开需要确定进入哪个界面就参考了这边文章,感谢作者的无私. 标签: 情况简述 在开发Android app的过程中,遇到这样一个需求:app中启动一个Servi ...
- Android实现点击通知栏后,先启动应用再打开目标Activity
情况简述 在开发Android app的过程中,遇到这样一个需求:app中启动一个Service,该Service在独立进程中运行,与服务器保持长连接,将服务器推送过来的消息在通知栏中显示,并设置点击 ...
- Android 主页面顶部栏的通知Notification ,可以自定义通知消息栏的风格,并且点击通知栏进人本程序。
常用的程序通知,显示到主页面的顶部栏. package com.lixu.tongzhi; import android.app.Activity; import android.app.Notifi ...
- android开发之Intent.setFlags()_让Android点击通知栏信息后返回正在运行的程序
android开发之Intent.setFlags()_让Android点击通知栏信息后返回正在运行的程序 在应用里使用了后台服务,并且在通知栏推送了消息,希望点击这个消息回到activity ...
- 收到远程通知,怎么区分是点击通知栏提醒进去的还是在foreground收到的通知?
我现在是要区分点击通知栏的通知进入应用还是点击应用图标进入的,1,开始程序都是在后台.2,接受通知都是在foreground状态.applicationdidFinishLaunchWithOptio ...
- asp.net 点击按钮,页面没有任何变化,后台代码不触发
asp.net 点击按钮,页面没有任何变化,后台代码不触发 和可能是 asp.net button 缺少validationGroup 导致的,需要查看页面的validation并且让他们抛出错误信 ...
- Easyui实用视频教程系列---Tree点击打开tab页面
Easyui实用视频教程系列---Tree点击打开tab页面 首先 我们 要搭建环境 easyui 环境 然后 把tree 给创建出来 在某个位置 粘贴 下面代码 <ul id="tt ...
- 设置a标签,实现点击跳转页面的两种效果
设置a标签,实现点击跳转页面 这个问题,主要是设置a标签的属性target,下面对target属性进行描述: 跳转在同一个窗口 1,target="_self", 它使得目标文档 ...
随机推荐
- CString 转换为 char*
CString str="这是一个测试"; char* str_0=str.GetBuffer(0);
- K皇后问题递归解法
#include<iostream> #include<cmath> #include<ctime> using namespace std; bool che ...
- Cat Snuke and a Voyage --AtCoder
题目描述 In Takahashi Kingdom, there is an archipelago of N islands, called Takahashi Islands. For conve ...
- 序列文件(seq_file)接口
转载:http://blog.csdn.net/gangyanliang/article/details/7244664 内容简介: 本文主要讲述序列文件(seq_file)接口的内核实现,如何使用它 ...
- Android Spinner In Toolbar
As the title of the post suggest in this tutorial we will see how to have spinner widget inside the ...
- JS: document.getElementBy(), setInerval()
ylbtech-JavaScript-DOM document.getElementBy(),setInerval() 1.A,document.getElementBy()返回顶部 document ...
- Linux学习之十八-sudo分权管理
sudo分权管理 1.为什么需要sudo? 当我的主机是多人共管的环境时,如果大家都使用 su 来切换成为 root 的身份,那么就得每个人知道 root 的密码,这样密码太多人知道可能会流出去,很不 ...
- ArcGIS教程:面积制表
摘要 计算两个数据集之间交叉制表的区域并输出表. 插图 使用方法 · 区域定义为输入中具有同样值的全部区.各区无需相连. 栅格和要素数据集都可用于区域输入. · 假设区域输入和类输入均为具有同样分辨率 ...
- MD5算法了解(JAVA实现)
MD5算法:尽管已经被破解,但任然广泛应用于各个领域中 如文件校验:当我们下载文件时为了保证文件的安全性,我们能够在其站点上找到相应的md5值进行校验,假设md5值不一致,也就是说文件被人动过(一般都 ...
- 出现“Windows资源管理器已停止工作”错误
出现"Windows资源管理器已停止工作"错误 什么是资源管理器呢,explorer.exe进程的作用就是让我们管理计算机中的资源! 今天开电脑的时候就一直提示windows资源管 ...