예배 규칙서 찾다
android Manifest Manifest.permission Manifest.permission_group android.accessibilityservice AccessibilityService android.accounts Account android.app NotificationManager android.bluetooth BluetoothAdapter BluetoothClass BluetoothClass.Device BluetoothClass.Device.Major BluetoothClass.Service BluetoothDevice BluetoothServerSocket BluetoothSocket android.content SharedPreferences android.database.sqlite SQLiteCursorDriver SQLiteOpenHelper android.graphics Bitmap android.location LocationListener Geocoder GpsStatus GpsStatus.Listener GpsStatus.NmeaListener GpsSatellite android.media AudioFormat AsyncPlayer AudioRecord AudioRecord.OnRecordPositionUpdateListener ThumbnailUtils AudioManager android.net TrafficStats MailTo LocalSocket android.os AsyncTask AsyncTask.Status CountDownTimer Message MessageQueue HandlerThread android.text Html android.util JsonWriter android.view ContextMenu ContextMenu.ContextMenuInfo Display ViewManager View ViewStub ViewTreeObserver ViewParent WindowManager GestureDetector Gravity MenuInflater ScaleGestureDetector SoundEffectConstants android.view.inputmethod InputConnection InputMethod InputMethodSession BaseInputConnection InputMethodManager android.widget AbsListView AbsListView.LayoutParams AbsListView.OnScrollListener AbsListView.RecyclerListener AbsoluteLayout AbsoluteLayout.LayoutParams AbsSeekBar AbsSpinner AdapterView AdapterView.AdapterContextMenuInfo AdapterView.OnItemLongClickListener AdapterView.OnItemSelectedListener AdapterView.OnItemClickListener AnalogClock BaseAdapter BaseExpandableListAdapter Button CheckBox CheckedTextView Checkable Chronometer Chronometer.OnChronometerTickListener CompoundButton CompoundButton.OnCheckedChangeListener CursorAdapter CursorTreeAdapter DatePicker DatePicker.OnDateChangedListener DialerFilter DigitalClock EditText Filter Filter.FilterListener Filter.FilterResults ExpandableListAdapter ExpandableListView.OnChildClickListener ExpandableListView.OnGroupClickListener ExpandableListView.OnGroupCollapseListener ExpandableListView.OnGroupExpandListener Filterable Gallery Gallery.LayoutParams GridView GridLayout GridLayout.Alignment RadioGroup ImageView ImageView.ScaleType HorizontalScrollView ImageButton ImageSwitcher FilterQueryProvider ListAdapter ListView MediaController MultiAutoCompleteTextView MultiAutoCompleteTextView.CommaTokenizer MultiAutoCompleteTextView.Tokenizer QuickContactBadge RadioButton RatingBar RatingBar.OnRatingBarChangeListener RelativeLayout RemoteViews ResourceCursorAdapter ResourceCursorTreeAdapter Scroller ScrollView SearchView SearchView.OnCloseListener SearchView.OnQueryTextListener SearchView.OnSuggestionListener SeekBar SeekBar.OnSeekBarChangeListener SimpleAdapter SimpleAdapter.ViewBinder SimpleCursorAdapter SimpleCursorAdapter.CursorToStringConverter SimpleCursorAdapter.ViewBinder SimpleCursorTreeAdapter SimpleCursorTreeAdapter.ViewBinder SimpleExpandableListAdapter SlidingDrawer SlidingDrawer.OnDrawerCloseListener SlidingDrawer.OnDrawerOpenListener SlidingDrawer.OnDrawerScrollListener Spinner SpinnerAdapter WrapperListAdapter TabHost TabHost.TabSpec TextView TimePicker TimePicker.OnTimeChangedListener Toast TableLayout TableLayout.LayoutParams TableRow TableRow.LayoutParams TabWidget TextSwitcher ToggleButton TwoLineListItem VideoView ViewAnimator ViewFlipper ViewSwitcher ViewSwitcher.ViewFactory ZoomButtonsController ZoomButtonsController.OnZoomListener ZoomButton ZoomControls dalvik.system DexFile
문자


NotificationManager

版本:Android 4.0 r1

 

结构

继承关系

public class NotificationManager extends Object

        

java.lang.Object

android.app.NotificationManager

 

类概述

该类用来向用户通知发生的事情。用来告诉用户在后台发生的某些事情。

通知有下列一些形式:

l   在状态栏中显示一个图片,可以通过launcher来访问(当用户点击该图片会启动一个预先定义好的intent

l   打开或者闪烁设备上的LED

l   或者通知用户通过闪烁的背光灯、播放声音或者震动

每个通知方法接受一个整型的id,还有一个字符串的标签参数可选,该参数可以为空。这两个参数被用来组成一对(tagid)或者如果标签没有指定则为(nullid)。这对参数用来在应用程序和系统中标识该通知。所以这对参数在你的程序中应该唯一。

如果你在通知方法时传递该参数对(tagid)和一些新的通知参数,如果(tagid)对应的通知应经在运行,则对应的通知会被更新。举个例子来说:如果你传递一个新的状态栏图片,状态栏中老的图片会被新的图片所替换。该(tagid)也用来传递给cancelId)或者cancelStringint)方法来清除这些通知。

NotificationManager不用实例化,可以通过getSystemServiceString)方法来获得。

开发者指南:创建一个通知,请阅读Status Bar Notifications开发者指南。

 

公共方法

public void cancel (int id)

         移除一个已经显示的通知,如果该通知是短暂的,会隐藏视图;如果通知是持久的,会从状态栏中移除。

参数

                            id      通知的id

                  

public void cancel (String tagint id)

移除一个已经显示的通知,如果该通知是短暂的,会隐藏视图;如果通知是持久的,会从状态栏中移除。        

参数

                            tag   通知的标签

                            id      通知的id

 

public void cancelAll ()

         移除所有的已经显示的通知,详细行为见cancel(int)

 

public void notify (int idNotification notification)

         提交一个通知在状态栏中显示。如果拥有相同id的通知已经被提交而且没有被移除,该方法会用新的信息来替换之前的通知。

参数

                   id      应用中通知的唯一标识

notification       一个通知对象用来描述向用户展示什么信息,不能为空

 

public void notify (String tagint idNotification notification)

提交一个通知在状态栏中显示。如果拥有相同标签和相同id的通知已经被提交而且没有被移除,该方法会用更新的信息来替换之前的通知。

参数

         tag   用来标识通知的字符串,可以为空。

                            id      应用中通知的唯一标识。

                            notification       一个通知对象用来描述向用户展示什么信息,不能为空。

 

补充

文章精选

AndroidNotification详解【android进化三十五】

 

 


이전 기사: 다음 기사: