精品欧美一区二区三区在线观看 _久久久久国色av免费观看性色_国产精品久久在线观看_亚洲第一综合网站_91精品又粗又猛又爽_小泽玛利亚一区二区免费_91亚洲精品国偷拍自产在线观看 _久久精品视频在线播放_美女精品久久久_欧美日韩国产成人在线

全面解析Notification

移動開發(fā) Android
Notification在Android中使用的頻率可以說是非常高的,本文我將圍繞著Notification的各方面進行解析,使大家對Notification有更好的認識。

Notification在Android中使用的頻率可以說是非常高的,本文我將圍繞著Notification的各方面進行解析,使大家對Notification有更好的認識。

Notification的使用步驟

1.獲取NotificationManager

  1. NotificationManager mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); 

2.創(chuàng)建NotificationCompat.Builder

  1. NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this); 

3.對Builder設(shè)置一些Notification相關(guān)屬性:

  1. mBuilder.setContentTitle("標(biāo)題")//設(shè)置通知欄標(biāo)題   
  2.     .setContentText("內(nèi)容") //設(shè)置通知欄顯示內(nèi)容  
  3.     .setContentIntent(getDefalutIntent(Notification.FLAG_AUTO_CANCEL)) //設(shè)置通知欄點擊意圖   
  4. //  .setNumber(number) //設(shè)置通知集合的數(shù)量   
  5.     .setTicker("通知到來") //通知***出現(xiàn)在通知欄,帶上升動畫效果的   
  6.     .setWhen(System.currentTimeMillis())//通知產(chǎn)生的時間,會在通知信息里顯示,一般是系統(tǒng)獲取到的時間   
  7.     .setPriority(Notification.PRIORITY_DEFAULT) //設(shè)置該通知優(yōu)先級   
  8. //  .setAutoCancel(true)//設(shè)置這個標(biāo)志當(dāng)用戶單擊面板就可以讓通知將自動取消     
  9.     .setOngoing(false)//ture,設(shè)置他為一個正在進行的通知。他們通常是用來表示一個后臺任務(wù),用戶積極參與(如播放音樂)或以某種方式正在等待,因此占用設(shè)備(如一個文件下載,同步操作,主動網(wǎng)絡(luò)連接)   
  10.     .setDefaults(Notification.DEFAULT_VIBRATE)//向通知添加聲音、閃燈和振動效果的最簡單、最一致的方式是使用當(dāng)前的用戶默認設(shè)置,使用defaults屬性,可以組合   
  11.     //Notification.DEFAULT_ALL  Notification.DEFAULT_SOUND 添加聲音 // requires VIBRATE permission   
  12.     .setSmallIcon(R.drawable.ic_launcher);//設(shè)置通知小ICON   

4.使用Builder創(chuàng)建通知

  1. Notification notification = mBuilder.build(); 

5.使用NotificationManager將通知推送出去

  1. int id = 199; 
  2. LogUtils.d(TAG, "創(chuàng)建通知"); 
  3. mNotificationManager.notify(id, notification);  

Notification重要方法解析

Notification 的基本操作主要有創(chuàng)建、更新、取消這三種。一個 Notification 的必要屬性有三項,如果不設(shè)置則在運行時會拋出異常:

  1. 小圖標(biāo),通過 setSmallIcon() 方法設(shè)置
  2. 標(biāo)題,通過 setContentTitle() 方法設(shè)置
  3. 內(nèi)容,通過 setContentText() 方法設(shè)置

除了以上三項,其它均為可選項。雖然如此,但還是應(yīng)該給 Notification 設(shè)置一個 Action ,這樣就可以直接跳轉(zhuǎn)到 App 的某個 Activity 、啟動一個 Service 或者發(fā)送一個 Broadcast。否則,Notification 僅僅只能起到通知的效果,而不能與用戶交互。

當(dāng)系統(tǒng)接收到通知時,可以通過震動、響鈴、呼吸燈等多種方式進行提醒。

1) setSmallIcon() 與 setLargeIcon()

在 NotificationCompat.Builder 中有設(shè)置通知的大小圖標(biāo)的兩個方法。這兩個方法有什么區(qū)別呢?當(dāng) setSmallIcon() 與 setLargeIcon() 同時存在時, smallIcon 顯示在largeIcon的右下角;當(dāng)只設(shè)置 setSmallIcon() 時, smallIcon 顯示在左側(cè)。看下圖你就明白了。對于部分 ROM ,可能修改過源碼,如 MIUI 上通知的大圖標(biāo)和小圖標(biāo)是沒有區(qū)別的。 

 

 

 

Google 官方是這么解釋 setSmallIcon() 這個方法的:

  1. Set the small icon resource, which will be used to represent the notification in the status bar. The platform template for the expanded view will draw this icon in the left, unless a large icon has also been specified, in which case the small icon will be moved to the right-hand side. 

2) 設(shè)置提醒標(biāo)志符Flags

方法解釋:提醒標(biāo)志符,向通知添加聲音、閃燈和振動效果等設(shè)置達到通知提醒效果,可以組合多個屬性

a) 創(chuàng)建通知欄之后通過給他添加.flags屬性賦值。

  1. Notification notification = mBuilder.build();   
  2. notification.flags = Notification.FLAG_AUTO_CANCEL;   

b) 通過setContentIntent(PendingIntent intent)方法中的意圖設(shè)置對應(yīng)的flags

  1. public PendingIntent getDefalutIntent(int flags){ 
  2.  
  3. PendingIntent pendingIntent= PendingIntent.getActivity(this, 1, new Intent(), flags); 
  4.  
  5. return pendingIntent; 
  6.  
  7.  

各標(biāo)志符介紹

  1. Notification.FLAG_SHOW_LIGHTS              //三色燈提醒,在使用三色燈提醒時候必須加該標(biāo)志符 
  2. Notification.FLAG_ONGOING_EVENT          //發(fā)起正在運行事件(活動中) 
  3. Notification.FLAG_INSISTENT   //讓聲音、振動***循環(huán),直到用戶響應(yīng) (取消或者打開) 
  4. Notification.FLAG_ONLY_ALERT_ONCE  //發(fā)起Notification后,鈴聲和震動均只執(zhí)行一次 
  5. Notification.FLAG_AUTO_CANCEL      //用戶單擊通知后自動消失 
  6. Notification.FLAG_NO_CLEAR          //只有全部清除時,Notification才會清除 ,不清楚該通知(QQ的通知無法清除,就是用的這個) 
  7. Notification.FLAG_FOREGROUND_SERVICE    //表示正在運行的服務(wù)  

3) .setDefaults(int defaults) (NotificationCompat.Builder中的方法,用于設(shè)置通知到來時,通過什么方式進行提示)

方法解釋:向通知添加聲音、閃燈和振動效果的最簡單、使用默認(defaults)屬性,可以組合多個屬性(和方法1中提示效果一樣的)

對應(yīng)屬性:

Notification.DEFAULT_VIBRATE //添加默認震動提醒 需要 VIBRATE permission

Notification.DEFAULT_SOUND // 添加默認聲音提醒

Notification.DEFAULT_LIGHTS// 添加默認三色燈提醒

Notification.DEFAULT_ALL// 添加默認以上3種全部提醒

  1. /** 
  2. * 顯示帶有默認鈴聲、震動、呼吸燈效果的通知 
  3. * 如需實現(xiàn)自定義效果,請參考后面三個例子 
  4. */ 
  5. private void showNotifyWithMixed() { 
  6.    NotificationCompat.Builder builder = new NotificationCompat.Builder(this) 
  7.            .setSmallIcon(R.mipmap.ic_launcher) 
  8.            .setContentTitle("我是有鈴聲+震動+呼吸燈效果的通知"
  9.            .setContentText("庫里就是叼~"
  10.            //等價于setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE); 
  11.            .setDefaults(Notification.DEFAULT_ALL); 
  12.    mManager.notify(5, builder.build()); 
  13.  

4) setVibrate(long[] pattern)

方法解釋:設(shè)置震動的時間

  1. .setVibrate(new long[] {0,300,500,700});   

實現(xiàn)效果:延遲0ms,然后振動300ms,在延遲500ms,接著在振動700ms。

還有另外一種寫法:

  1. mBuilder.build().vibrate = new long[] {0,300,500,700};   

如果希望設(shè)置默認振動方式,設(shè)置了方法(2)中默認為DEFAULT_VIBRATE 即可。

例子:

  1. /** 
  2. * 展示有震動效果的通知,需要在AndroidManifest.xml中申請震動權(quán)限 
  3. * <uses-permission android:name="android.permission.VIBRATE" /> 
  4. * 補充:測試震動的時候,手機的模式一定要調(diào)成鈴聲+震動模式,否則你是感受不到震動的 
  5. */ 
  6. private void showNotifyWithVibrate() { 
  7.    //震動也有兩種設(shè)置方法,與設(shè)置鈴聲一樣,在此不再贅述 
  8.    long[] vibrate = new long[]{0, 500, 1000, 1500}; 
  9.    NotificationCompat.Builder builder = new NotificationCompat.Builder(this) 
  10.            .setSmallIcon(R.mipmap.ic_launcher) 
  11.            .setContentTitle("我是伴有震動效果的通知"
  12.            .setContentText("顫抖吧,凡人~"
  13.            //使用系統(tǒng)默認的震動參數(shù),會與自定義的沖突 
  14.            //.setDefaults(Notification.DEFAULT_VIBRATE) 
  15.            //自定義震動效果 
  16.            .setVibrate(vibrate); 
  17.    //另一種設(shè)置震動的方法 
  18.    //Notification notify = builder.build(); 
  19.    //調(diào)用系統(tǒng)默認震動 
  20.    //notify.defaults = Notification.DEFAULT_VIBRATE; 
  21.    //調(diào)用自己設(shè)置的震動 
  22.    //notify.vibrate = vibrate; 
  23.    //mManager.notify(3,notify); 
  24.    mManager.notify(3, builder.build()); 
  25.  

4)方法:.setLights(intledARGB ,intledOnMS ,intledOffMS )

方法解釋:android支持三色燈提醒,這個方法就是設(shè)置不同場景下的不同顏色的燈。

描述:其中l(wèi)edARGB 表示燈光顏色、 ledOnMS 亮持續(xù)時間、ledOffMS 暗的時間。

注意:

1)只有在設(shè)置了標(biāo)志符Flags為Notification.FLAG_SHOW_LIGHTS的時候,才支持三色燈提醒。

2)這邊的顏色跟設(shè)備有關(guān),不是所有的顏色都可以,要看具體設(shè)備。

  1. Notification notify = mBuilder.build();   
  2. notify .setLights(0xff00eeff, 500, 200)  

同理,以下方法也可以設(shè)置同樣效果:

  1. Notification notify = mBuilder.build();   
  2. notify.flags = Notification.FLAG_SHOW_LIGHTS;   
  3. notify.ledARGB = 0xff00eeff;   
  4. notify.ledOnMS = 500;   
  5. notify.ledOffMS = 400;   

如果希望使用默認的三色燈提醒,設(shè)置了方法(2)中默認為DEFAULT_LIGHTS即可。

例子:

  1. /** 
  2. * 顯示帶有呼吸燈效果的通知,但是不知道為什么,自己這里測試沒成功 
  3. */ 
  4. private void showNotifyWithLights() { 
  5.    final NotificationCompat.Builder builder = new NotificationCompat.Builder(this) 
  6.            .setSmallIcon(R.mipmap.ic_launcher) 
  7.            .setContentTitle("我是帶有呼吸燈效果的通知"
  8.            .setContentText("一閃一閃亮晶晶~"
  9.            //ledARGB 表示燈光顏色、 ledOnMS 亮持續(xù)時間、ledOffMS 暗的時間 
  10.            .setLights(0xFF0000, 3000, 3000); 
  11.    Notification notify = builder.build(); 
  12.    //只有在設(shè)置了標(biāo)志符Flags為Notification.FLAG_SHOW_LIGHTS的時候,才支持呼吸燈提醒。 
  13.    notify.flags = Notification.FLAG_SHOW_LIGHTS; 
  14.    //設(shè)置lights參數(shù)的另一種方式 
  15.    //notify.ledARGB = 0xFF0000; 
  16.    //notify.ledOnMS = 500; 
  17.    //notify.ledOffMS = 5000; 
  18.    //使用handler延遲發(fā)送通知,因為連接usb時,呼吸燈一直會亮著 
  19.    Handler handler = new Handler(); 
  20.    handler.postDelayed(new Runnable() { 
  21.        @Override 
  22.        public void run() { 
  23.            mManager.notify(4, builder.build()); 
  24.        } 
  25.    }, 10000); 
  26.  

5)方法:.setSound(Uri sound)

方法解釋:設(shè)置默認或則自定義的鈴聲,來提醒。

  1. //獲取默認鈴聲   
  2. .setDefaults(Notification.DEFAULT_SOUND)   
  3. //獲取自定義鈴聲   
  4. .setSound(Uri.parse("file:///sdcard/dance.mp3"))   
  5. //獲取Android多媒體庫內(nèi)的鈴聲   
  6. .setSound(Uri.withAppendedPath(Audio.Media.INTERNAL_CONTENT_URI, "5"))    

同理相同效果的另一種設(shè)置方法這邊就不講, 和上面的都是一樣的。

例子:

  1. /** 
  2. * 展示有自定義鈴聲效果的通知 
  3. * 補充:使用系統(tǒng)自帶的鈴聲效果:Uri.withAppendedPath(Audio.Media.INTERNAL_CONTENT_URI, "6"); 
  4. */ 
  5. private void showNotifyWithRing() { 
  6.    NotificationCompat.Builder builder = new NotificationCompat.Builder(this) 
  7.            .setSmallIcon(R.mipmap.ic_launcher) 
  8.            .setContentTitle("我是伴有鈴聲效果的通知"
  9.            .setContentText("美妙么?安靜聽~"
  10.            //調(diào)用系統(tǒng)默認響鈴,設(shè)置此屬性后setSound()會無效 
  11.            //.setDefaults(Notification.DEFAULT_SOUND) 
  12.            //調(diào)用系統(tǒng)多媒體褲內(nèi)的鈴聲 
  13.            //.setSound(Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI,"2")); 
  14.            //調(diào)用自己提供的鈴聲,位于 /res/values/raw 目錄下 
  15.            .setSound(Uri.parse("android.resource://com.littlejie.notification/" + R.raw.sound)); 
  16.    //另一種設(shè)置鈴聲的方法 
  17.    //Notification notify = builder.build(); 
  18.    //調(diào)用系統(tǒng)默認鈴聲 
  19.    //notify.defaults = Notification.DEFAULT_SOUND; 
  20.    //調(diào)用自己提供的鈴聲 
  21.    //notify.sound = Uri.parse("android.resource://com.littlejie.notification/"+R.raw.sound); 
  22.    //調(diào)用系統(tǒng)自帶的鈴聲 
  23.    //notify.sound = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI,"2"); 
  24.    //mManager.notify(2,notify); 
  25.    mManager.notify(2, builder.build()); 
  26.  

6)方法:.setPriority(int pri)

方法解釋:設(shè)置優(yōu)先級(實際項目中并無大用,設(shè)置***級也不會使得你的通知欄出現(xiàn)在***位) 

 

 

 

對應(yīng)屬性:

  1. Notification.PRIORITY_DEFAULT(優(yōu)先級為0)
  2. Notification.PRIORITY_HIGH
  3. Notification.PRIORITY_LOW
  4. Notification.PRIORITY_MAX(優(yōu)先級為2)
  5. Notification.PRIORITY_MIN(優(yōu)先級為-2)

Notification.PRIORITY_MAX是優(yōu)先級***,Notification.PRIORITY_MIN優(yōu)先級***

7)方法:setOngoing(boolean ongoing)

方法解釋:設(shè)置為ture,表示它為一個正在進行的通知。他們通常是用來表示一個后臺任務(wù),用戶積極參與(如播放音樂)或以某種方式正在等待,因此占用設(shè)備(如一個文件下載,同步操作,主動網(wǎng)絡(luò)連接)

PS:我們看到360手機衛(wèi)士的通知欄一直固定在手機中,就是通過設(shè)置這個標(biāo)記,使用該標(biāo)記后你的通知欄無法被用戶手動進行刪除,只能通過代碼進行刪除,慎用

8)setProgress(int max, int progress,boolean indeterminate)

屬性:max:進度條***數(shù)值 、progress:當(dāng)前進度、indeterminate:表示進度是否不確定,true為不確定,false為確定

功能:設(shè)置帶進度條的通知,可以在下載中使用

注意:此方法在4.0及以后版本才有用,如果為早期版本:需要自定義通知布局,其中包含ProgressBar視圖

使用:如果為確定的進度條:調(diào)用setProgress(max, progress, false)來設(shè)置通知,在更新進度的時候在此發(fā)起通知更新progress,并且在下載完成后要移除進度條,通過調(diào)用setProgress(0, 0, false)既可。

如果為不確定(持續(xù)活動)的進度條,這是在處理進度無法準(zhǔn)確獲知時顯示活動正在持續(xù),所以調(diào)用setProgress(0, 0, true) ,操作結(jié)束時,調(diào)用setProgress(0, 0, false)并更新通知以移除指示條

9)如何更新 Notification

更新通知很簡單,只需要再次發(fā)送相同 ID 的通知即可,如果之前的通知還未被取消,則會直接更新該通知相關(guān)的屬性;如果之前的通知已經(jīng)被取消,則會重新創(chuàng)建一個新通知。

更新通知跟發(fā)送通知使用相同的方式。

  1. private void refreshNotification() { 
  2.    //獲取NotificationManager實例 
  3.    NotificationManager notifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); 
  4.    //實例化NotificationCompat.Builde并設(shè)置相關(guān)屬性 
  5.    NotificationCompat.Builder builder = new NotificationCompat.Builder(this) 
  6.            //設(shè)置小圖標(biāo) 
  7.            .setSmallIcon(R.mipmap.icon_fab_repair) 
  8.            //設(shè)置通知標(biāo)題 
  9.            .setContentTitle("最簡單的Notification"
  10.            //設(shè)置通知內(nèi)容 
  11.            .setContentText("只有小圖標(biāo)、標(biāo)題、內(nèi)容"
  12.            //設(shè)置通知時間,默認為系統(tǒng)發(fā)出通知的時間,通常不用設(shè)置 
  13.            //.setWhen(System.currentTimeMillis()); 
  14.    //通過builder.build()方法生成Notification對象,并發(fā)送通知,id=1 
  15.    notifyManager.notify(1, builder.build()); 
  16.  

10)如何取消 Notification?

取消通知有如下 5 種方式:

1. 點擊通知欄的清除按鈕,會清除所有可清除的通知

2. 設(shè)置了 setAutoCancel() 或 FLAG_AUTO_CANCEL 的通知,點擊該通知時會清除它

3. 通過 NotificationManager 調(diào)用 cancel(int id) 方法清除指定 ID 的通知

4. 通過 NotificationManager 調(diào)用 cancel(String tag, int id) 方法清除指定 TAG 和 ID 的通知

5. 通過 NotificationManager 調(diào)用 cancelAll() 方法清除所有該應(yīng)用之前發(fā)送的通知

如果你是通過 NotificationManager.notify(String tag, int id, Notification notify) 方法創(chuàng)建的通知,那么只能通過 NotificationManager.cancel(String tag, int id) 方法才能清除對應(yīng)的通知,調(diào)用NotificationManager.cancel(int id) 無效。

例子: 

  1. public class DemoActivity extends Activity implements View.OnClickListener { 
  2.  
  3.     //Notification.FLAG_FOREGROUND_SERVICE    //表示正在運行的服務(wù) 
  4.     public static final String NOTIFICATION_TAG = "test"
  5.     public static final int DEFAULT_NOTIFICATION_ID = 1; 
  6.  
  7.     private NotificationManager mNotificationManager; 
  8.  
  9.     @Override 
  10.     protected void onCreate(Bundle savedInstanceState) { 
  11.         super.onCreate(savedInstanceState); 
  12.         setContentView(R.layout.activity_simple_notification); 
  13.  
  14.         findViewById(R.id.btn_remove_all_notification).setOnClickListener(this); 
  15.         findViewById(R.id.btn_send_notification).setOnClickListener(this); 
  16.         findViewById(R.id.btn_remove_notification).setOnClickListener(this); 
  17.         findViewById(R.id.btn_send_notification_with_tag).setOnClickListener(this); 
  18.         findViewById(R.id.btn_remove_notification_with_tag).setOnClickListener(this); 
  19.         findViewById(R.id.btn_send_ten_notification).setOnClickListener(this); 
  20.         findViewById(R.id.btn_send_flag_no_clear_notification).setOnClickListener(this); 
  21.         findViewById(R.id.btn_send_flag_ongoing_event_notification).setOnClickListener(this); 
  22.         findViewById(R.id.btn_send_flag_auto_cancecl_notification).setOnClickListener(this); 
  23.  
  24.         mNotificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE); 
  25.     } 
  26.  
  27.     @Override 
  28.     public void onClick(View v) { 
  29.         switch (v.getId()) { 
  30.             case R.id.btn_remove_all_notification: 
  31.                 //移除當(dāng)前 Context 下所有 Notification,包括 FLAG_NO_CLEAR 和 FLAG_ONGOING_EVENT 
  32.                 mNotificationManager.cancelAll(); 
  33.                 break; 
  34.             case R.id.btn_send_notification: 
  35.                 //發(fā)送一個 Notification,此處 ID = 1 
  36.                 sendNotification(); 
  37.                 break; 
  38.             case R.id.btn_remove_notification: 
  39.                 //移除 ID = 1 的 Notification,注意:該方法只針對當(dāng)前 Context。 
  40.                 mNotificationManager.cancel(DEFAULT_NOTIFICATION_ID); 
  41.                 break; 
  42.             case R.id.btn_send_notification_with_tag: 
  43.                 //發(fā)送一個 ID = 1 并且 TAG = littlejie 的 Notification 
  44.                 //注意:此處發(fā)送的通知與 sendNotification() 發(fā)送的通知并不沖突 
  45.                 //因為此處的 Notification 帶有 TAG 
  46.                 sendNotificationWithTag(); 
  47.                 break; 
  48.             case R.id.btn_remove_notification_with_tag: 
  49.                 //移除一個 ID = 1 并且 TAG = littlejie 的 Notification 
  50.                 //注意:此處移除的通知與 NotificationManager.cancel(int id) 移除通知并不沖突 
  51.                 //因為此處的 Notification 帶有 TAG 
  52.                 mNotificationManager.cancel(NOTIFICATION_TAG, DEFAULT_NOTIFICATION_ID); 
  53.                 break; 
  54.             case R.id.btn_send_ten_notification: 
  55.                 //連續(xù)發(fā)十條 Notification 
  56.                 sendTenNotifications(); 
  57.                 break; 
  58.             case R.id.btn_send_flag_no_clear_notification: 
  59.                 //發(fā)送 ID = 1, flag = FLAG_NO_CLEAR 的 Notification 
  60.                 //下面兩個 Notification 的 ID 都為 1,會發(fā)現(xiàn) ID 相等的 Notification 會被***的替換掉 
  61.                 sendFlagNoClearNotification(); 
  62.                 break; 
  63.             case R.id.btn_send_flag_auto_cancecl_notification: 
  64.                 sendFlagOngoingEventNotification(); 
  65.                 break; 
  66.             case R.id.btn_send_flag_ongoing_event_notification: 
  67.                 sendFlagAutoCancelNotification(); 
  68.                 break; 
  69.         } 
  70.     } 
  71.  
  72.     /** 
  73.      * 發(fā)送最簡單的通知,該通知的ID = 1 
  74.      */ 
  75.     private void sendNotification() { 
  76.         //這里使用 NotificationCompat 而不是 Notification ,因為 Notification 需要 API 16 才能使用 
  77.         //NotificationCompat 存在于 V4 Support Library 
  78.         NotificationCompat.Builder builder = new NotificationCompat.Builder(this) 
  79.                 .setSmallIcon(R.mipmap.ic_launcher) 
  80.                 .setContentTitle("Send Notification"
  81.                 .setContentText("Hi,My id is 1"); 
  82.         mNotificationManager.notify(DEFAULT_NOTIFICATION_ID, builder.build()); 
  83.     } 
  84.  
  85.     /** 
  86.      * 使用notify(String tag, int id, Notification notification)方法發(fā)送通知 
  87.      * 移除對應(yīng)通知需使用 cancel(String tag, int id) 
  88.      */ 
  89.     private void sendNotificationWithTag() { 
  90.         NotificationCompat.Builder builder = new NotificationCompat.Builder(this) 
  91.                 .setSmallIcon(R.mipmap.ic_launcher) 
  92.                 .setContentTitle("Send Notification With Tag"
  93.                 .setContentText("Hi,My id is 1,tag is " + NOTIFICATION_TAG); 
  94.         mNotificationManager.notify(NOTIFICATION_TAG, DEFAULT_NOTIFICATION_ID, builder.build()); 
  95.     } 
  96.  
  97.     /** 
  98.      * 循環(huán)發(fā)送十個通知 
  99.      */ 
  100.     private void sendTenNotifications() { 
  101.         for (int i = 0; i < 10; i++) { 
  102.             NotificationCompat.Builder builder = new NotificationCompat.Builder(this) 
  103.                     .setSmallIcon(R.mipmap.ic_launcher) 
  104.                     .setContentTitle("Send Notification Batch"
  105.                     .setContentText("Hi,My id is " + i); 
  106.             mNotificationManager.notify(i, builder.build()); 
  107.         } 
  108.     } 
  109.  
  110.     /** 
  111.      * 設(shè)置FLAG_NO_CLEAR 
  112.      * 該 flag 表示該通知不能被狀態(tài)欄的清除按鈕給清除掉,也不能被手動清除,但能通過 cancel() 方法清除 
  113.      * Notification.flags屬性可以通過 |= 運算疊加效果 
  114.      */ 
  115.     private void sendFlagNoClearNotification() { 
  116.         NotificationCompat.Builder builder = new NotificationCompat.Builder(this) 
  117.                 .setSmallIcon(R.mipmap.ic_launcher) 
  118.                 .setContentTitle("Send Notification Use FLAG_NO_CLEAR"
  119.                 .setContentText("Hi,My id is 1,i can't be clear."); 
  120.         Notification notification = builder.build(); 
  121.         //設(shè)置 Notification 的 flags = FLAG_NO_CLEAR 
  122.         //FLAG_NO_CLEAR 表示該通知不能被狀態(tài)欄的清除按鈕給清除掉,也不能被手動清除,但能通過 cancel() 方法清除 
  123.         //flags 可以通過 |= 運算疊加效果 
  124.         notification.flags |= Notification.FLAG_NO_CLEAR; 
  125.         mNotificationManager.notify(DEFAULT_NOTIFICATION_ID, notification); 
  126.     } 
  127.  
  128.     /** 
  129.      * 設(shè)置FLAG_AUTO_CANCEL 
  130.      * 該 flag 表示用戶單擊通知后自動消失 
  131.      */ 
  132.     private void sendFlagAutoCancelNotification() { 
  133.         //設(shè)置一個Intent,不然點擊通知不會自動消失 
  134.         Intent resultIntent = new Intent(this, MainActivity.class); 
  135.         PendingIntent resultPendingIntent = PendingIntent.getActivity( 
  136.                 this, 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT); 
  137.         NotificationCompat.Builder builder = new NotificationCompat.Builder(this) 
  138.                 .setSmallIcon(R.mipmap.ic_launcher) 
  139.                 .setContentTitle("Send Notification Use FLAG_AUTO_CLEAR"
  140.                 .setContentText("Hi,My id is 1,i can be clear."
  141.                 .setContentIntent(resultPendingIntent); 
  142.         Notification notification = builder.build(); 
  143.         //設(shè)置 Notification 的 flags = FLAG_NO_CLEAR 
  144.         //FLAG_AUTO_CANCEL 表示該通知能被狀態(tài)欄的清除按鈕給清除掉 
  145.         //等價于 builder.setAutoCancel(true); 
  146.         notification.flags |= Notification.FLAG_AUTO_CANCEL; 
  147.         mNotificationManager.notify(DEFAULT_NOTIFICATION_ID, notification); 
  148.     } 
  149.  
  150.     /** 
  151.      * 設(shè)置FLAG_ONGOING_EVENT 
  152.      * 該 flag 表示發(fā)起正在運行事件(活動中) 
  153.      */ 
  154.     private void sendFlagOngoingEventNotification() { 
  155.         NotificationCompat.Builder builder = new NotificationCompat.Builder(this) 
  156.                 .setSmallIcon(R.mipmap.ic_launcher) 
  157.                 .setContentTitle("Send Notification Use FLAG_ONGOING_EVENT"
  158.                 .setContentText("Hi,My id is 1,i can't be clear."); 
  159.         Notification notification = builder.build(); 
  160.         //設(shè)置 Notification 的 flags = FLAG_NO_CLEAR 
  161.         //FLAG_ONGOING_EVENT 表示該通知通知放置在正在運行,不能被手動清除,但能通過 cancel() 方法清除 
  162.         //等價于 builder.setOngoing(true); 
  163.         notification.flags |= Notification.FLAG_ONGOING_EVENT; 
  164.         mNotificationManager.notify(DEFAULT_NOTIFICATION_ID, notification); 
  165.     }     
  166.  

給Notification設(shè)置PendingIntent

PendingIntent可以通過setContentIntent(PendingIntent intent)這個方法進行設(shè)置

當(dāng)我們點擊通知欄時想跳轉(zhuǎn)一個Activity或者開啟一個service時,就可以通過設(shè)置PendingIntent達成

PendingIntent 是 Android 系統(tǒng)管理并持有的用于描述和獲取原始數(shù)據(jù)的對象的標(biāo)志(引用)。也就是說,即便創(chuàng)建該PendingIntent對象的進程被殺死了,這個PendingItent對象在其他進程中還是可用的。

日常使用中的短信、鬧鐘等都用到了 PendingIntent。

PendingIntent 主要可以通過以下三種方式獲取:

  1. //獲取一個用于啟動 Activity 的 PendingIntent 對象 
  2. public static PendingIntent getActivity(Context context, int requestCode, Intent intent, int flags); 
  3.  
  4. //獲取一個用于啟動 Service 的 PendingIntent 對象 
  5. public static PendingIntent getService(Context context, int requestCode, Intent intent, int flags); 
  6.  
  7. //獲取一個用于向 BroadcastReceiver 廣播的 PendingIntent 對象 
  8. public static PendingIntent getBroadcast(Context context, int requestCode, Intent intent, int flags)  

PendingIntent 具有以下幾種 flag:

FLAG_CANCEL_CURRENT:如果當(dāng)前系統(tǒng)中已經(jīng)存在一個相同的 PendingIntent 對象,那么就將先將已有的 PendingIntent 取消,然后重新生成一個 PendingIntent 對象。

FLAG_NO_CREATE:如果當(dāng)前系統(tǒng)中不存在相同的 PendingIntent 對象,系統(tǒng)將不會創(chuàng)建該 PendingIntent 對象而是直接返回 null 。

FLAG_ONE_SHOT:該 PendingIntent 只作用一次。

FLAG_UPDATE_CURRENT:如果系統(tǒng)中已存在該 PendingIntent 對象,那么系統(tǒng)將保留該 PendingIntent 對象,但是會使用新的 Intent 來更新之前 PendingIntent 中的 Intent 對象數(shù)據(jù),例如更新 Intent 中的 Extras 。

自定義Notification

Android系統(tǒng)允許使用RemoteViews來自定義通知。自定義普通視圖通知高度限制為64dp,大視圖通知高度限制為256dp。同時,建議自定義通知盡量簡單,以提高兼容性。

自定義通知需要做如下操作:1、創(chuàng)建自定義通知布局2、使用RemoteViews定義通知組件,如圖標(biāo)、文字等3、調(diào)用setContent()將RemoteViews對象綁定到NotificationCompat.Builder4、同正常發(fā)送通知流程

注意: 避免為通知設(shè)置背景,因為兼容性原因,有些文字可能看不清。

關(guān)于自定義Notification兼容問題,請閱讀我的另一篇博客 Android通知欄版本兼容解決方案

例子:

  1. RemoteViews notifactionView = new RemoteViews(mContext.getPackageName(), 
  2.         R.layout.cl_screen_notification); 
  3. mBuilder.setContent(notifactionView); 
  4. notifactionView.setOnClickPendingIntent(R.id.cl_screen_notification, pendingIntent); 
  5. Bitmap pluginIcon = drawableToBitmap(pluginDrawable); 
  6. LogUtils.d("myl""獲得icon" + pluginIcon); 
  7. notifactionView.setImageViewBitmap(R.id.cl_plugin_icon, pluginIcon); 
  8. notifactionView.setTextViewText(R.id.dl_plugin_msg, pluginContent); 
  9. Notification notification = mBuilder.build(); 
  10. int id = 199; 
  11. LogUtils.d(TAG, "創(chuàng)建通知"); 
  12. mNotificationManager.notify(id, notification);  

Notification的各種樣式

1) BigText樣式(Android 4.1以上)

a) ***高度一般為256dp

b) 不是***的通知時默認為折疊狀態(tài)

c) 不設(shè)置SummaryText的話,展開后最下面一行的內(nèi)容會消失

例子:

  1. private void showBigViewText() { 
  2.          NotificationCompat.BigTextStyle textStyle = new BigTextStyle(); 
  3.          textStyle 
  4.                  .setBigContentTitle("BigContentTitle"
  5.                  .setSummaryText("SummaryText"
  6.                  .bigText( 
  7.                          "I am Big Text"); 
  8.          Notification notification = new NotificationCompat.Builder(context) 
  9.                  .setLargeIcon(icon).setSmallIcon(R.drawable.ic_launcher) 
  10.                  .setTicker("showBigView_Text").setContentInfo("contentInfo"
  11.                  .setContentTitle("ContentTitle").setContentText("ContentText"
  12.                  .setStyle(textStyle) 
  13.                  .setAutoCancel(true).setDefaults(Notification.DEFAULT_ALL) 
  14.                  .build(); 
  15.          manager.notify(NOTIFICATION_ID_2, notification); 
  16.      }  

2) Inbox樣式

a) 高度一般為256dp

b) 不是***的通知時默認為折疊狀態(tài)

c) 不設(shè)置SummaryText的話,展開后最下面一行的內(nèi)容會消失

例子:

  1. private void showBigViewInbox() { 
  2.         NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle(); 
  3.         inboxStyle.setBigContentTitle("BigContentTitle").setSummaryText( 
  4.                 "SummaryText"); 
  5.         for (int i = 0; i < 5; i++) 
  6.             inboxStyle.addLine("news:" + i); 
  7.         Notification notification = new NotificationCompat.Builder(context) 
  8.                 .setLargeIcon(icon).setSmallIcon(R.drawable.ic_launcher) 
  9.                 .setTicker("showBigView_Inbox").setContentInfo("contentInfo"
  10.                 .setContentTitle("ContentTitle").setContentText("ContentText"
  11.                 .setStyle(inboxStyle) 
  12.                 .setAutoCancel(true).setDefaults(Notification.DEFAULT_ALL) 
  13.                 .build(); 
  14.         manager.notify(NOTIFICATION_ID_4, notification); 
  15.     }  

3) BigPicture樣式

a) 高度一般為256dp

b) 不是***的通知時為默認折疊狀態(tài)

c) 不設(shè)置SummaryText的話,展開后第二行字的內(nèi)容會消失

例子:

  1. private void showBigViewPic() { 
  2.          NotificationCompat.BigPictureStyle pictureStyle = new BigPictureStyle(); 
  3.          pictureStyle.setBigContentTitle("BigContentTitle"
  4.                  .setSummaryText("SummaryText").bigPicture(icon); 
  5.          Notification notification = new NotificationCompat.Builder(context) 
  6.                  .setLargeIcon(icon).setSmallIcon(R.drawable.ic_launcher) 
  7.                  .setTicker("showBigView_Pic").setContentInfo("contentInfo"
  8.                  .setContentTitle("ContentTitle").setContentText("ContentText"
  9.                  .setStyle(pictureStyle) 
  10.                  .setAutoCancel(true).setDefaults(Notification.DEFAULT_ALL) 
  11.                  .build(); 
  12.          manager.notify(NOTIFICATION_ID_3, notification); 
  13.      }  

4) 折疊式Notification

折疊式Notification是一種自定義視圖的Notification,用來顯示長文本和一些自定義的布局的場景。它有兩種狀態(tài),一種是普通狀態(tài)下的視圖,一種是展開狀態(tài)下的視圖。和普通Notification不同的是,我們需要自定義的視圖,而這個視圖顯示的進程和我們創(chuàng)建視圖的進程不再一個進程,所以我們需要使用RemoteViews,首先要使用RemoteViews來創(chuàng)建我們的自定義視圖:

  1. //用RemoteViews來創(chuàng)建自定義Notification視圖 
  2. RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.view);  

視圖的布局文件:

  1. <?xml version="1.0" encoding="utf-8"?> 
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
  3.     android:layout_width="match_parent" 
  4.     android:layout_height="100dp" 
  5.     android:background="@drawable/fold" 
  6.     android:orientation="horizontal"
  7. <ImageView 
  8.     android:id="@+id/iv_image" 
  9.     android:layout_width="100dp" 
  10.     android:layout_height="100dp" 
  11.     android:src="@drawable/fold" 
  12.     /> 
  13.  
  14.     <TextView 
  15.         android:id="@+id/tv_text" 
  16.         android:layout_width="wrap_content" 
  17.         android:layout_height="wrap_content" 
  18.         android:layout_marginTop="30dp" 
  19.         android:layout_marginLeft="150dp" 
  20.         android:text="展開后的視圖" 
  21.         android:textColor="@color/colorPrimaryDark"/> 
  22. </LinearLayout>  

把自定義視圖賦值給Notification展開時的視圖

  1. //指定展開時的視圖 
  2. notification.bigContentView = remoteViews;  

也可以把自定義視圖賦值給Notification普通狀態(tài)時的視圖

  1. //指定普通狀態(tài)時的視圖 
  2. notification.contentView = remoteViews;  

折疊式Notification完整代碼:

  1. Notification.Builder builder = new Notification.Builder(this); 
  2.        Intent mIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://blog.csdn.net/itachi85/")); 
  3.        PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, mIntent, 0); 
  4.        builder.setContentIntent(pendingIntent); 
  5.        builder.setSmallIcon(R.drawable.foldleft); 
  6.        builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.lanucher)); 
  7.        builder.setAutoCancel(true); 
  8.        builder.setContentTitle("折疊式通知"); 
  9.        //用RemoteViews來創(chuàng)建自定義Notification視圖 
  10.        RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.view_fold); 
  11.        Notification notification = builder.build(); 
  12.        //指定展開時的視圖 
  13.        notification.bigContentView = remoteViews; 
  14.        notificationManager.notify(1, notification);  

5) 懸掛式Notification (5.0新增)

懸掛式Notification是android5.0新增加的方式,懸掛式Notification不需要下拉通知欄就直接顯示出來懸掛在屏幕上方并且焦點不變?nèi)栽谟脩舨僮鞯慕缑嬉虼瞬粫驍嘤脩舻牟僮鳎^幾秒就會自動消失。他需要調(diào)用setFullScreenIntent來將Notification變?yōu)閼覓焓絅otification

  1. //如果描述的PendingIntent已經(jīng)存在,則在產(chǎn)生新的Intent之前會先取消掉當(dāng)前的 
  2.         PendingIntent hangPendingIntent = PendingIntent.getActivity(this, 0, hangIntent, PendingIntent.FLAG_CANCEL_CURRENT); 
  3.         builder.setFullScreenIntent(hangPendingIntent, true);  

懸掛式Notification完整代碼:

  1. Notification.Builder builder = new Notification.Builder(this); 
  2.         Intent mIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://blog.csdn.net/itachi85/")); 
  3.         PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, mIntent, 0); 
  4.         builder.setContentIntent(pendingIntent); 
  5.         builder.setSmallIcon(R.drawable.foldleft); 
  6.         builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.lanucher)); 
  7.         builder.setAutoCancel(true); 
  8.         builder.setContentTitle("懸掛式通知"); 
  9.         //設(shè)置點擊跳轉(zhuǎn) 
  10.         Intent hangIntent = new Intent(); 
  11.         hangIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
  12.         hangIntent.setClass(this, MyNotificationActivity.class); 
  13.         //如果描述的PendingIntent已經(jīng)存在,則在產(chǎn)生新的Intent之前會先取消掉當(dāng)前的 
  14.         PendingIntent hangPendingIntent = PendingIntent.getActivity(this, 0, hangIntent, PendingIntent.FLAG_CANCEL_CURRENT); 
  15.         builder.setFullScreenIntent(hangPendingIntent, true); 
  16.         notificationManager.notify(2, builder.build());   

 

 

 

6) 鎖屏通知

Android 5.0(API level 21)開始,通知可以顯示在鎖屏上。用戶可以通過設(shè)置選擇是否允許敏感的通知內(nèi)容顯示在安全的鎖屏上。你的應(yīng)用可以通過setVisibility()控制通知的顯示等級:

VISIBILITY_PRIVATE : 顯示基本信息,如通知的圖標(biāo),但隱藏通知的全部內(nèi)容

VISIBILITY_PUBLIC : 顯示通知的全部內(nèi)容

VISIBILITY_SECRET : 不顯示任何內(nèi)容,包括圖標(biāo)

  1. builder.setVisibility(Notification.VISIBILITY_PUBLIC);  
責(zé)任編輯:龐桂玉 來源: Android開發(fā)中文站
相關(guān)推薦

2025-06-27 07:19:48

2024-08-29 08:28:17

2010-06-24 15:35:04

IPx協(xié)議

2010-03-09 17:19:01

Linux時鐘

2010-07-22 09:25:09

telnet命令

2011-07-07 08:49:14

iPhone Push Notificati

2011-04-12 15:00:48

Oracle碎片

2010-01-06 17:12:57

Linux主要構(gòu)成

2010-06-28 18:52:49

UML關(guān)系符號

2021-11-23 09:09:27

Applicationandroid系統(tǒng)開發(fā)

2009-07-17 17:02:54

JRuby是什么

2009-10-19 15:07:17

Visual Basi

2021-11-19 17:26:11

AppApplication方法

2009-07-06 09:17:51

2009-11-11 17:02:44

MPLS路由協(xié)議

2010-10-20 15:11:53

SQL Server作

2024-11-15 10:58:40

2009-12-25 16:47:04

Linux Make規(guī)

2010-09-25 14:12:50

Java內(nèi)存分配

2012-11-15 13:42:29

點贊
收藏

51CTO技術(shù)棧公眾號

国产一区 二区| 福利在线午夜| 国产一区成人| 中文字幕在线成人| 少妇高潮一69aⅹ| 91超碰在线| 国产精品丝袜一区| 翡翠波斯猫1977年美国| 成人免费一级片| 国产精品vip| 在线观看视频亚洲| 88av在线播放| 永久免费观看精品视频| 欧美视频免费在线| 台湾无码一区二区| 国产精品麻豆一区二区三区| 国产伦理精品不卡| 国产精品9999| 91浏览器在线观看| 久久久国产精品| 亚洲精品视频在线播放| 免费国偷自产拍精品视频| 韩国三级一区| 精品国产91久久久久久老师| 在线视频一区观看| 国产午夜视频在线观看| www.成人网.com| 亚洲伊人一本大道中文字幕| 国产精品传媒在线观看| 一区二区国产精品| 欧美激情网友自拍| 欧美黑人猛猛猛| 波多野结衣在线观看一区二区| 亚洲精品国产精品自产a区红杏吧| 日日干日日操日日射| 暖暖成人免费视频| 疯狂做受xxxx欧美肥白少妇| 久久福利一区二区| 天使と恶魔の榨精在线播放| 亚洲欧美在线另类| 亚洲一区二区三区四区中文| 黄色网址在线播放| 久久美女高清视频| 久久久综合亚洲91久久98| 色婷婷在线视频| 粉嫩久久99精品久久久久久夜| 亚洲精品欧美日韩| 国产精品福利电影| 国产一区在线看| 亚洲一区二区三| 国产女人18毛片水18精| 狠狠色丁香久久婷婷综| 91性高湖久久久久久久久_久久99| 在线观看黄色国产| 久久国产夜色精品鲁鲁99| 国产精品入口免费视| 中文天堂在线资源| 久久97超碰国产精品超碰| 国产欧美一区二区三区在线 | 黄网站app在线观看| 中文无字幕一区二区三区| 日韩久久久久久久久久久久久| 欧美黄色小说| 中文字幕精品在线不卡| 一区二区三区国| a视频在线观看| 亚洲激情av在线| 精品国产一区二区三区无码| 国产美女高潮在线观看| 色乱码一区二区三区88 | 国产精品一二三四| 成人动漫视频在线观看完整版| 亚洲老妇色熟女老太| 成人一区二区三区在线观看| 精品久久sese| wwwxxx在线观看| 最新热久久免费视频| 天天做天天躁天天躁| 国产乱码精品一区二三赶尸艳谈| 日韩欧美中文字幕在线观看| 国产 porn| 精品国产亚洲一区二区三区在线| 欧美成人在线直播| 国内精品久久99人妻无码| 欧美日韩一二三四| 欧美成人高清视频| 久久精品国产成人av| 麻豆91在线播放免费| 99久久精品无码一区二区毛片| 无码国产精品高潮久久99| 国产欧美日韩三级| 国产又粗又猛又爽又黄的网站| 日韩脚交footjobhd| 欧美年轻男男videosbes| 亚洲精品一区二区18漫画| 先锋影音国产精品| 久久天天躁日日躁| 久久国产视频一区| 国产精品影视在线观看| 欧美在线视频二区| 久久青青色综合| 欧美午夜影院一区| 国产伦精品一区三区精东| 成人一区二区| 91wwwcom在线观看| 精品人妻久久久久一区二区三区| 久久久久久久网| 青青草综合视频| 国产福利一区二区三区在线播放| 精品电影一区二区三区| 国产一二三av| 亚洲一区二区三区高清不卡| 亚洲a∨日韩av高清在线观看| 欧美老女人性开放| 亚洲午夜免费视频| 色91精品久久久久久久久| 日韩欧美影院| 欧美激情在线观看视频| 一级黄色片免费看| 久久精品欧美日韩| 黄色一级片播放| 亚洲成人黄色| 久久精品国产亚洲一区二区| 亚洲天堂五月天| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 亚洲天堂2018av| 午夜电影一区| 久久天天躁狠狠躁夜夜av| 免费黄色一级大片| 久久久精品免费观看| 日韩中文字幕在线视频观看| 亚洲一区二区三区在线免费 | 欧美自拍资源在线| 美女网站在线看| 欧美精品一区二区三区久久久| 91香蕉视频在线播放| 美女脱光内衣内裤视频久久影院| 久久久一本精品99久久精品| 黄色在线免费观看网站| 亚洲精品成人久久| 国产无遮挡又黄又爽在线观看| 国产九色精品成人porny | 亚洲在线观看| 精品福利影视| 国产精品一二三产区| 亚洲精品第一页| 五月天综合激情| 99r国产精品| 美女日批免费视频| 一区二区三区日本久久久| 2020久久国产精品| 奇米影视888狠狠狠777不卡| 欧美性少妇18aaaa视频| 国产毛片久久久久久久| 日本欧美一区二区| 一本一道久久久a久久久精品91| 成人不卡视频| 欧美成人免费播放| 亚洲奶汁xxxx哺乳期| 五月激情综合婷婷| 麻豆精品免费视频| 日本少妇一区二区| 美女在线免费视频| 亚洲3区在线| 97精品国产97久久久久久| 四虎影视2018在线播放alocalhost| 丁香五六月婷婷久久激情| 亚洲一区二区三区蜜桃| 日韩 欧美一区二区三区| 杨幂一区欧美专区| 精品国产欧美| 7777免费精品视频| h视频在线观看免费| 91精品久久久久久久99蜜桃| 久久久久久久国产精品毛片| 99久久久无码国产精品| 日韩视频免费在线播放| 仙踪林久久久久久久999| 成人免费在线看片| 欧美片第1页| 久久久国产成人精品| 好吊视频一二三区| 在线视频综合导航| 欧美久久久久久久久久久久| 91小视频免费看| 亚洲涩涩在线观看| 亚洲深夜激情| 在线成人av电影| 老汉色老汉首页av亚洲| 国产精品99久久久久久久久| 国产丝袜在线| 亚洲欧美日韩中文视频| av无码精品一区二区三区宅噜噜| 韩曰欧美视频免费观看| 亚洲熟女毛茸茸| 91香蕉视频mp4| 伦伦影院午夜理论片| 亚洲伊人观看| 香港三级日本三级a视频| 国产成人一区| 成人午夜影院在线观看| av免费在线一区| 欧美激情免费看| 91在线导航| 日韩成人av一区| www.av网站| 欧美日韩激情在线| 亚洲男人的天堂在线视频| 亚洲欧美一区二区久久| 亚洲一区视频在线播放| 99re8在线精品视频免费播放| 亚洲欧美天堂在线| 日韩电影一区二区三区| 国产视频九色蝌蚪| 欧美久久九九| 中文字幕在线中文字幕日亚韩一区| 日本精品影院| 国产精品v欧美精品v日韩精品| 国产精品4hu.www| 国产91在线视频| 老色鬼在线视频| 欧美贵妇videos办公室| 免费大片在线观看www| 日韩精品在线私人| 日韩在线视频观看免费| 日韩视频在线一区二区| 一级黄色片免费| 欧美亚洲禁片免费| 国产又粗又猛又黄视频| 精品国产91久久久| 久久精品国产亚洲av无码娇色| 亚洲婷婷综合色高清在线| 99国产精品免费| 国产日韩v精品一区二区| 女同毛片一区二区三区| 成人av网站免费| 一起草在线视频| 成人av网在线| www.日本高清| 91一区一区三区| 黄色污在线观看| 91美女福利视频| 在线 丝袜 欧美 日韩 制服| 成人一区二区三区中文字幕| 欧美丰满熟妇bbb久久久| 国产成人精品一区二 | 久久久精品日韩欧美| 中文字幕被公侵犯的漂亮人妻| 久久夜色精品国产欧美乱极品| 午夜av免费看| 久久综合色婷婷| 中文字幕av网址| 久久亚洲一区二区三区明星换脸| 亚洲国产精品成人综合久久久| 99国产精品视频免费观看| 国产伦精品一区二区三区妓女 | 色噜噜色狠狠狠狠狠综合色一 | 肉大捧一出免费观看网站在线播放| 久久久人成影片免费观看| 久久久久久久久网| 一区二区日韩免费看| 日韩有码免费视频| 蜜桃av一区二区三区电影| 中文字幕成人在线视频| 国产在线国偷精品免费看| 一级黄色大片免费看| 成人精品免费网站| 成年人免费观看视频网站| 国产精品久久久久久久久免费相片| 三级黄色在线观看| 亚洲精品欧美专区| 日本在线免费观看| 色婷婷久久综合| 国产露脸无套对白在线播放| 精品成a人在线观看| 欧美xxx.com| 日韩视频在线免费观看| 日本孕妇大胆孕交无码| 欧洲成人在线观看| 亚洲精品成人一区| 国产伦精品一区二区三区免 | 日韩黄色片在线| 亚洲欧美成人| 日韩av福利在线观看| 成人午夜电影小说| 日本欧美一区二区三区不卡视频| 亚洲理论在线观看| 丰满少妇xoxoxo视频| 在线电影欧美成精品| 日本美女一级视频| 中文字幕精品网| 888av在线视频| 成人疯狂猛交xxx| 国产精品一区二区三区美女| 四虎永久国产精品| 亚洲小说欧美另类社区| 欧美精品性生活| 波多野结衣视频一区| 午夜国产福利视频| 日韩欧美一区视频| 亚洲第一天堂网| 中文字幕精品—区二区| 麻豆免费版在线观看| 成人在线视频福利| 在线看成人短视频| 青青在线视频免费观看| 日韩va欧美va亚洲va久久| 亚洲av人人澡人人爽人人夜夜| 欧美韩国日本一区| 日日摸天天添天天添破| 欧美一级二级三级蜜桃| 高清中文字幕一区二区三区| 午夜精品视频在线| 日韩精品三级| 亚洲精品永久www嫩草| 性欧美暴力猛交另类hd| 91精品又粗又猛又爽| 亚洲丝袜自拍清纯另类| 国产情侣免费视频| 日韩精品福利在线| 日本资源在线| 91精品国产91久久久久青草| 日韩伦理一区| 亚洲xxxx2d动漫1| 久久精品在线免费观看| 波多野结衣国产| 欧美一二区视频| 国产在线1区| 成人春色激情网| 91视频一区| 亚洲老女人av| 日本一二三不卡| 亚洲午夜在线播放| 亚洲图片制服诱惑| 欧美电影免费观看网站| 精品一区二区三区自拍图片区| 亚洲午夜一级| 亚洲欧美高清在线| 亚洲第一成人在线| 天天综合天天综合| 69视频在线免费观看| 日韩mv欧美mv国产网站| 鲁一鲁一鲁一鲁一色| 99久久99久久精品国产片果冻| 国产精品日日夜夜| 亚洲精品电影在线观看| 阿v视频在线| 欧美主播一区二区三区美女 久久精品人| 亚洲精品九九| 中文字幕xxx| 色噜噜狠狠色综合中国| 高清毛片在线看| 国产欧美精品一区二区三区介绍| 久久在线视频免费观看| 男生操女生视频在线观看| 亚洲丝袜美腿综合| 蜜桃91麻豆精品一二三区| 国内偷自视频区视频综合| 免费看久久久| 成年人视频在线免费| 欧美经典一区二区三区| 亚洲天堂网在线观看视频| 久久视频免费观看| caoporn成人免费视频在线| 欧美亚洲精品一区二区| 久久精品亚洲精品国产欧美| 中文字幕 日韩有码| 久青草国产97香蕉在线视频| 一区二区日韩| 99999精品视频| 国产精品网站一区| 国产理论视频在线观看| 久久久久久尹人网香蕉| 国产精品一区二区av日韩在线| 999在线免费视频| 亚洲欧美视频在线观看视频| 天天操天天操天天操| 国产精品免费福利| 欧美日韩国产高清| 熟女人妻在线视频| 欧美日韩在线播放| 久草在线新免费首页资源站| 免费不卡亚洲欧美| 九色综合狠狠综合久久| 日本免费在线播放| 国产一区二区三区高清在线观看| 国产资源一区| 国产无限制自拍| 国产精品伦一区二区三级视频| 亚洲精品久久久久久动漫器材一区| 欧洲一区二区视频| 欧美精品综合| www.xx日本| 国产丝袜一区二区三区| 精品国模一区二区三区欧美| 日韩a∨精品日韩在线观看| 国产精品日产欧美久久久久| 性生活黄色大片| 国产精品美女午夜av| 日韩视频一区|