zoukankan      html  css  js  c++  java
  • 2.6.2 Notification的功能与用法

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:orientation="vertical" >
    
        <Button
            android:id="@+id/btn1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="发送通知" />
    
        <Button
            android:id="@+id/btn2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal" 
            android:text="取消通知">
        </Button>
    
    </LinearLayout>
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.moon.hello2"
        android:versionCode="1"
        android:versionName="1.0" >
    
        <uses-sdk
            android:minSdkVersion="11"
            android:targetSdkVersion="18" />
    
        <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme" >
            <activity
                android:name="com.moon.hello2.MainActivity"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity
                android:name="com.moon.hello2.OtherActivity"
                android:label="@string/title_activity_other" >
            </activity>
        </application>
    
    </manifest>

    notification需要指定lastevent 否则会导致notify时构造消息提示view出错的运行时错误

  • 相关阅读:
    集合
    字典
    列表
    事件兼容性封装
    E5中遍历数组的方法
    canvas绘制三等分饼型图
    canvas制作刮刮乐案例
    canvas绘制饼型图
    javascript中手风琴特效
    javascript中client()兼容性封装
  • 原文地址:https://www.cnblogs.com/Moon-Face/p/4533845.html
Copyright © 2011-2022 走看看