- 浏览: 238962 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
江恂泽:
楼主 这家伙会把data 拆分开来 转换成day year形 ...
JsonUtil -
mdsp25xhm:
为何没有列表查询功能?
myBatis DAO封装
NotificationManager mNotificationManager = (NotificationManager) myContext.getSystemService(NOTIFICATION_SERVICE);
long when = System.currentTimeMillis();
Notification notification = new Notification(resource, tickerText, when);
/*
* Notification.FLAG_AUTO_CANCEL ,该标志表示当用户点击 Clear 之后,能够清除该通知
*/
notification.flags = Notification.FLAG_ONGOING_EVENT;
notification.flags = Notification.FLAG_NO_CLEAR; //永久存在,不能删除
notification.defaults = Notification.DEFAULT_SOUND; //声音
notification.defaults = Notification.DEFAULT_LIGHTS; //灯光
notification.defaults = Notification.DEFAULT_VIBRATE; //震动
/*
* 创建点击事件开启Activity对象
*
* 如果要以该Intent启动一个Activity,一定要设置 Intent.FLAG_ACTIVITY_NEW_TASK 标记
* Intent.FLAG_ACTIVITY_CLEAR_TOP :如果在当前Task中,有要启动的Activity,
* 那么把该Acitivity之前的所有Activity都关掉,并把此Activity置前以避免创建Activity的实例
*/
Intent notificationIntent = new Intent(myContext, VoiceIdentifyActivity.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK);
/*
* 点击启动Activity 和startActivity()同含义
* 表示如果该描述的PendingIntent已存在,则改变已存在的PendingIntent的Extra数据为新的PendingIntent的Extra数据。
*/
PendingIntent contentIntent = PendingIntent.getActivity(myContext, 0 , notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
notification.setLatestEventInfo(myContext, contentTitle, contentText,contentIntent);
/*
* 用mNotificationManager的notify方法通知用户生成标题栏消息通知
*/
mNotificationManager.notify(R.string.app_name, notification);
long when = System.currentTimeMillis();
Notification notification = new Notification(resource, tickerText, when);
/*
* Notification.FLAG_AUTO_CANCEL ,该标志表示当用户点击 Clear 之后,能够清除该通知
*/
notification.flags = Notification.FLAG_ONGOING_EVENT;
notification.flags = Notification.FLAG_NO_CLEAR; //永久存在,不能删除
notification.defaults = Notification.DEFAULT_SOUND; //声音
notification.defaults = Notification.DEFAULT_LIGHTS; //灯光
notification.defaults = Notification.DEFAULT_VIBRATE; //震动
/*
* 创建点击事件开启Activity对象
*
* 如果要以该Intent启动一个Activity,一定要设置 Intent.FLAG_ACTIVITY_NEW_TASK 标记
* Intent.FLAG_ACTIVITY_CLEAR_TOP :如果在当前Task中,有要启动的Activity,
* 那么把该Acitivity之前的所有Activity都关掉,并把此Activity置前以避免创建Activity的实例
*/
Intent notificationIntent = new Intent(myContext, VoiceIdentifyActivity.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK);
/*
* 点击启动Activity 和startActivity()同含义
* 表示如果该描述的PendingIntent已存在,则改变已存在的PendingIntent的Extra数据为新的PendingIntent的Extra数据。
*/
PendingIntent contentIntent = PendingIntent.getActivity(myContext, 0 , notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
notification.setLatestEventInfo(myContext, contentTitle, contentText,contentIntent);
/*
* 用mNotificationManager的notify方法通知用户生成标题栏消息通知
*/
mNotificationManager.notify(R.string.app_name, notification);
发表评论
-
IMF简介-2
2013-07-09 17:56 858InputManager 由UI控件(View,TextVie ... -
IMF简介-1
2013-07-09 17:51 779Input Method Framework 目录 ... -
输入法 总结-3
2013-07-08 15:02 824public class MainActivity exten ... -
输入法 总结-4
2013-07-04 17:29 905public class InputActivity exte ... -
输入法 总结-3
2013-07-04 17:28 835public class InputApplication e ... -
输入法 总结-2
2013-07-04 17:23 743openwnn_pref_ja.xml <?xml v ... -
输入法 总结-2
2013-07-04 17:21 13openwnn_pref_ja.xml <?xml v ... -
输入法 总结-1
2013-07-04 17:19 769<application android ... -
Android快捷键
2013-03-15 14:39 775Home键(小房子键) 在 ... -
如何通过wifi调试android程序
2013-02-27 15:48 719android手机居然可以通过wifi进行程序的调试,太好了, ... -
Please ensure that adb is correctly located at 'D:\android-sdk-windows\platform-
2013-02-27 14:27 1617adt 出现ADB server didn't ACK, fa ... -
Android AsyncTask
2013-02-19 09:35 1066AsyncTask是抽象类,子类 ... -
Android ViewPager 左右滑动2-1
2013-01-29 10:12 1413public class PagerActivity exte ... -
Android ViewPager 左右滑动-3
2013-01-29 10:10 1070<?xml version="1.0" ... -
Android ViewPager 左右滑动-2
2013-01-29 10:10 1406/*** * 选中效果 */ pu ... -
Android ViewPager 左右滑动-1
2013-01-29 10:09 1339Store extends ActivityGroup imp ... -
Android 下载
2013-01-27 00:59 873下载apk程序代码 protected File downLo ... -
Android SDCard操作-3
2013-01-26 18:31 849public static Intent getVid ... -
Android SDCard操作-2
2013-01-26 18:30 1044/** * 判断该应用在手机中的安装情况 ... -
Android SDCard操作-1
2013-01-26 18:27 1004private static int INSTALLED = ...
相关推荐
android Notifacation通知,注意手机在设置中允许应用通知 否则收不到通知。
Android 通知(notification)简单实用Demo,包含点击功能简单例子,供大家下载学习
android Scroller使用小例子
DEMO实现功能: ...RecyclerView Item之间添加分隔线:垂直与水平方向 RecyclerView 单个与多个Item的添加与删除 RecyclerView Item添加与删除动画效果 ...LayoutManager的使用 详见http://blog.csdn.net/yalinfendou
主要介绍了Android Notification使用方法总结的相关资料,这里提供了四种使用方法,需要的朋友可以参考下
Android中使用Shape自定义形状
博客地址 http://blog.csdn.net/sbsujjbcy/article/details/49520791
android中使用TextureView播放视频。TextureView使用变换(平移、缩放、旋转等)方便。也可以放在ListView或者ScrollView中,使用UI控件的一些特性比如View.setAlpha()。 博客地址:...
《Android C++高级编程——使用NDK》提供了Java原生接口(JNI)的概述、Bionic API、POSIX 线程和套接字、C++支持、原生图形和声音API以及NEON/SIMD优化,在一个游戏应用案例的帮助下,你将学到很多关键技能。...
不管你是想将已经存在的原生代码应用移植到Android平台上还是准备开始在Android平台上进行软件开发,使用《Android C++高级编程——使用NDK》一书提供的技术可以构建更出色的应用。本书将展示构建性能更好的复杂原生...
Android使用Activity用作弹出式对话框
Android上自带的的wget是链接到busybox,某些需要复杂参数的下载情况不能被满足,比如需要带cookie的时候。这个版本的wget是通过wget源码编译得到的完整版本。
可以获取系统的内存和可用内存,cpu的实时使用率
Android上使用OpenCV打开摄像头源码,不需要安装OpenCV Manager
Android开发中使用CRC校验,博客地址:http://blog.csdn.net/duanbokan/article/details/51282614
Android中Camera使用案例
Android下使用Canvas画图,详细参见博客:http://www.cnblogs.com/plokmju/p/android_Canvas.html
亲手码制28页AndroidStudio使用文档
Android Studio使用ViewPager+Fragment实现仿微信滑动切换界面
Android下使用SurfaceView播放视频文件,详细参见博客:http://www.cnblogs.com/plokmju/p/android_SurfaceView.html