当前位置:  编程技术>移动开发
本页文章导读:
    ▪Notification运用        Notification使用   代码:package com.my; import android.app.Activity;import android.app.Notification;import android.app.NotificationManager;import android.app.PendingIntent;import android.content.Intent;import android.os.Bundle;import android.pr.........
    ▪ 最精准的view,canvas,surface其间的关系        最精准的view,canvas,surface之间的关系 Views are not attached to the Canvas nor the Surface. The window is tied to a Surface and the ViewRoot asks the Surface for a Canvas that is then used by the Views to draw onto. ......
    ▪ stm32 间断号 for IAR PowerPac       stm32 中断号 for IAR PowerPac   00 DCD __intial_sp 01 DCD __iar_program_start 02 DCD NMI_Handler ; NMI Handler 03 DCD HardFault_Handler ; Hard Fault Handler 04 DCD MemMan.........

[1]Notification运用
    来源: 互联网  发布时间: 2014-02-18
Notification使用



 

代码:
package com.my;

import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
import android.provider.ContactsContract.CommonDataKinds.Note;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.RemoteViews;
import android.widget.RemoteViews.RemoteView;
import android.widget.TextView;

public class NotificationActivity extends Activity implements OnClickListener {
    private Button btnNotify_all;

    private Button btnNotify_lights;

    private Button btnNotify_sound;

    private Button btnNotify_vibrate;

    private Button btnCancelAll;

    private Button btnCustomview;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        TextView textView = (TextView)findViewById(R.id.tv);
        textView.setText("Buhh");
        btnNotify_all = (Button)findViewById(R.id.btnNotify_all);
        btnNotify_all.setOnClickListener(this);
        btnNotify_lights = (Button)findViewById(R.id.btnNotify_lights);
        btnNotify_lights.setOnClickListener(this);
        btnNotify_sound = (Button)findViewById(R.id.btnNotify_sound);
        btnNotify_sound.setOnClickListener(this);
        btnNotify_vibrate = (Button)findViewById(R.id.btnNotify_vibrate);
        btnNotify_vibrate.setOnClickListener(this);
        btnCancelAll = (Button)findViewById(R.id.btnCancelAll);
        btnCancelAll.setOnClickListener(this);
        btnCustomview = (Button)findViewById(R.id.btnCustomView);
        btnCustomview.setOnClickListener(this);

    }

    private void showSimple(int id) {
        // 第一步
        NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
        // 第二步
        Notification notification = new Notification(R.drawable.icon, "new message",
                System.currentTimeMillis());
        notification.defaults = id;
        // 第三步
        Intent intent = new Intent(this, NotificationActivity.class);
        PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
        // 第四步
        notification.setLatestEventInfo(this, "message", "hellow", pendingIntent);
        // 第五步
        notificationManager.notify(R.layout.main, notification);
    }

    private void showLedLight() {
        // 第一步
        NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
        // 第二步
        Notification notification = new Notification(R.drawable.icon, "new message",
                System.currentTimeMillis());
        // notification.defaults = Notification.DEFAULT_LIGHTS;
        notification.ledARGB = 0xffffff;
        notification.ledOnMS = 300;
        notification.ledOffMS = 1000;
        notification.flags = Notification.FLAG_SHOW_LIGHTS;
        // 第三步
        Intent intent = new Intent(this, NotificationActivity.class);
        PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
        // 第四步
        notification.setLatestEventInfo(this, "message", "hellow", pendingIntent);
        // 第五步
        notificationManager.notify(R.layout.main, notification);
    }

    private void cancelAll() {
        NotificationManager manager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
        manager.cancelAll();
    }

    private void customView() {
        NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
        Notification notification = new Notification(R.drawable.icon, "new message",
                System.currentTimeMillis());
        RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.mynotificationview);
        contentView.setImageViewResource(R.id.ivShow, R.drawable.icon);
        notification.contentView = contentView;
        Intent notificationIntent = new Intent(this, NotificationActivity.class);
        PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
        notification.contentIntent = contentIntent;
        notificationManager.notify(0, notification);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btnNotify_all:
                showSimple(Notification.DEFAULT_ALL);
                break;
            case R.id.btnNotify_lights:
                showLedLight();
                break;
            case R.id.btnNotify_sound:
                showSimple(Notification.DEFAULT_SOUND);
                break;
            case R.id.btnNotify_vibrate:
                showSimple(Notification.DEFAULT_VIBRATE);
                break;
            case R.id.btnCustomView:
                customView();
                break;
            case R.id.btnCancelAll:
                cancelAll();
                break;
            default:
                break;
        }
    }
}


    
[2] 最精准的view,canvas,surface其间的关系
    来源: 互联网  发布时间: 2014-02-18
最精准的view,canvas,surface之间的关系

Views are not attached to the Canvas nor the Surface. The window is tied to a Surface and the ViewRoot asks the Surface for a Canvas that is then used by the Views to draw onto.


    
[3] stm32 间断号 for IAR PowerPac
    来源: 互联网  发布时间: 2014-02-18
stm32 中断号 for IAR PowerPac

 

00        DCD     __intial_sp
01        DCD     __iar_program_start
02        DCD     NMI_Handler               ; NMI Handler
03        DCD     HardFault_Handler         ; Hard Fault Handler
04        DCD     MemManage_Handler         ; MPU Fault Handler
05        DCD     BusFault_Handler          ; Bus Fault Handler
06        DCD     UsageFault_Handler        ; Usage Fault Handler
07        DCD     0                         ; Reserved
08        DCD     0                         ; Reserved
09        DCD     0                         ; Reserved
10        DCD     0                         ; Reserved
11        DCD     SVC_Handler               ; SVCall Handler
12        DCD     DebugMon_Handler          ; Debug Monitor Handler
13        DCD     0                         ; Reserved
14        DCD     PendSV_Handler            ; PendSV Handler
15        DCD     SysTick_Handler           ; SysTick Handler
16        DCD     WWDG_IRQHandler           ; Window Watchdog
17        DCD     PVD_IRQHandler            ; PVD through EXTI Line detect
18        DCD     TAMPER_IRQHandler         ; Tamper
19        DCD     RTC_IRQHandler            ; RTC
20        DCD     FLASH_IRQHandler          ; Flash
21        DCD     RCC_IRQHandler            ; RCC
22        DCD     EXTI0_IRQHandler          ; EXTI Line 0
23        DCD     EXTI1_IRQHandler          ; EXTI Line 1
24        DCD     EXTI2_IRQHandler          ; EXTI Line 2
25        DCD     EXTI3_IRQHandler          ; EXTI Line 3
26        DCD     EXTI4_IRQHandler          ; EXTI Line 4
27        DCD     DMA1_Channel1_IRQHandler  ; DMA1 Channel 1
28        DCD     DMA1_Channel2_IRQHandler  ; DMA1 Channel 2
29        DCD     DMA1_Channel3_IRQHandler  ; DMA1 Channel 3
30        DCD     DMA1_Channel4_IRQHandler  ; DMA1 Channel 4
31        DCD     DMA1_Channel5_IRQHandler  ; DMA1 Channel 5
32        DCD     DMA1_Channel6_IRQHandler  ; DMA1 Channel 6
33        DCD     DMA1_Channel7_IRQHandler  ; DMA1 Channel 7
34        DCD     ADC1_2_IRQHandler         ; ADC1 & ADC2
35        DCD     USB_HP_CAN1_TX_IRQHandler  ; USB High Priority or CAN1 TX
36        DCD     USB_LP_CAN1_RX0_IRQHandler ; USB Low  Priority or CAN1 RX0
37        DCD     CAN1_RX1_IRQHandler       ; CAN1 RX1
38        DCD     CAN1_SCE_IRQHandler       ; CAN1 SCE
39        DCD     EXTI9_5_IRQHandler        ; EXTI Line 9..5
40        DCD     TIM1_BRK_IRQHandler       ; TIM1 Break
41        DCD     TIM1_UP_IRQHandler        ; TIM1 Update
42        DCD     TIM1_TRG_COM_IRQHandler   ; TIM1 Trigger and Commutation
43        DCD     TIM1_CC_IRQHandler        ; TIM1 Capture Compare
44        DCD     TIM2_IRQHandler           ; TIM2
45        DCD     TIM3_IRQHandler           ; TIM3
46        DCD     TIM4_IRQHandler           ; TIM4
47        DCD     I2C1_EV_IRQHandler        ; I2C1 Event
48        DCD     I2C1_ER_IRQHandler        ; I2C1 Error
49        DCD     I2C2_EV_IRQHandler        ; I2C2 Event
50        DCD     I2C2_ER_IRQHandler        ; I2C2 Error
51        DCD     SPI1_IRQHandler           ; SPI1
52        DCD     SPI2_IRQHandler           ; SPI2
53        DCD     USART1_IRQHandler         ; USART1
54        DCD     USART2_IRQHandler         ; USART2
55        DCD     USART3_IRQHandler         ; USART3
56        DCD     EXTI15_10_IRQHandler      ; EXTI Line 15..10
57        DCD     RTCAlarm_IRQHandler       ; RTC Alarm through EXTI Line
58        DCD     USBWakeUp_IRQHandler      ; USB Wakeup from suspend
59        DCD     TIM8_BRK_IRQHandler       ; TIM8 Break
60        DCD     TIM8_UP_IRQHandler        ; TIM8 Update
61        DCD     TIM8_TRG_COM_IRQHandler   ; TIM8 Trigger and Commutation
62        DCD     TIM8_CC_IRQHandler        ; TIM8 Capture Compare
63        DCD     ADC3_IRQHandler           ; ADC3
64        DCD     FSMC_IRQHandler           ; FSMC
65        DCD     SDIO_IRQHandler           ; SDIO
66        DCD     TIM5_IRQHandler           ; TIM5
67        DCD     SPI3_IRQHandler           ; SPI3
68        DCD     UART4_IRQHandler          ; UART4
69        DCD     UART5_IRQHandler          ; UART5
70        DCD     TIM6_IRQHandler           ; TIM6
71        DCD     TIM7_IRQHandler           ; TIM7
72        DCD     DMA2_Channel1_IRQHandler  ; DMA2 Channel1
73        DCD     DMA2_Channel2_IRQHandler  ; DMA2 Channel2
74        DCD     DMA2_Channel3_IRQHandler  ; DMA2 Channel3
75        DCD     DMA2_Channel4_5_IRQHandler ; DMA2 Channel4 & Channel5

    
最新技术文章:
▪Android开发之登录验证实例教程
▪Android开发之注册登录方法示例
▪Android获取手机SIM卡运营商信息的方法
▪Android实现将已发送的短信写入短信数据库的...
▪Android发送短信功能代码
▪Android根据电话号码获得联系人头像实例代码
▪Android中GPS定位的用法实例
▪Android实现退出时关闭所有Activity的方法
▪Android实现文件的分割和组装
▪Android录音应用实例教程
▪Android双击返回键退出程序的实现方法
▪Android实现侦听电池状态显示、电量及充电动...
▪Android获取当前已连接的wifi信号强度的方法
▪Android实现动态显示或隐藏密码输入框的内容
▪根据USER-AGENT判断手机类型并跳转到相应的app...
▪Android Touch事件分发过程详解
▪Android中实现为TextView添加多个可点击的文本
▪Android程序设计之AIDL实例详解
▪Android显式启动与隐式启动Activity的区别介绍
▪Android按钮单击事件的四种常用写法总结
▪Android消息处理机制Looper和Handler详解
▪Android实现Back功能代码片段总结
▪Android实用的代码片段 常用代码总结
▪Android实现弹出键盘的方法
▪Android中通过view方式获取当前Activity的屏幕截...
▪Android提高之自定义Menu(TabMenu)实现方法
▪Android提高之多方向抽屉实现方法
▪Android提高之MediaPlayer播放网络音频的实现方法...
▪Android提高之MediaPlayer播放网络视频的实现方法...
▪Android提高之手游转电视游戏的模拟操控
 


站内导航:


特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

©2012-2021,,E-mail:www_#163.com(请将#改为@)

浙ICP备11055608号-3