使用Notification
来源:互联网 发布:java数组sort方法 编辑:程序博客网 时间:2024/05/17 01:38
package com.itheima74.test;import android.app.Notification;import android.app.NotificationManager;import android.content.Context;import android.graphics.BitmapFactory;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.view.View;public class MainActivity extends AppCompatActivity { private NotificationManager mNm; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mNm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); } // 点击按钮,发送一条通知 public void click1(View view) { // 创建一条通知 Notification noti = new Notification.Builder(this) .setContentTitle("New mail from 110@qq.com") .setContentText("哈哈哈哈哈...") .setSmallIcon(R.mipmap.ic_launcher) .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher)) .build(); mNm.notify(10, noti); } // 点击按钮,关闭该条通知 public void click2(View view) { mNm.cancel(10); }}
0 0
- Notification 使用
- Notification使用
- 使用Notification
- Notification 使用
- notification 使用
- Notification使用
- Notification使用
- 使用Notification
- notification使用
- Notification---Notification使用详解之一:基础应用
- Notification的使用(自定义Notification布局)
- 使用 WS-Notification
- 3. Notification的使用
- 3、Notification的使用
- Android-Notification的使用
- Android NOtification 使用
- iphone notification及使用
- Android Notification的使用
- AsyncTask的使用
- vue.js关于Object.defineProperty的利用原理
- No plugin found for prefix 'war' in the current project and in the plugin groups
- dom4j修改,获取,增加xml中某个元素的属性值
- 《CSS权威指南第三版》第六章-文本属性的读书笔记
- 使用Notification
- 用于Activity管理和应用程序退出
- C primer plus C 第六章控制语句:循环 编程练习个人练习
- linux 工作调度
- To be the better one for programing
- JAVA scanner扫描器和BufferedReader流输入的用法
- (3)防火墙的应用----NAT和ACL
- springmvc配置
- temp