精品欧美一区二区三区在线观看 _久久久久国色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ù)棧公眾號

色影院视频在线| 国产一区免费看| 在线日韩成人| 亚洲一区二区三区中文字幕在线| 成人av中文| 欧美h在线观看| 国产成人1区| 欧美精品久久99久久在免费线 | 无码国产色欲xxxx视频| 日韩成人一区二区| 欧美大片免费观看| 尤物视频最新网址| 91综合久久爱com| 色88888久久久久久影院按摩| 美女黄色片网站| 天堂v视频永久在线播放| 秋霞午夜鲁丝一区二区老狼| 久精品免费视频| 日本爱爱爱视频| 精品人人人人| 欧美一区二区网站| 免费男同深夜夜行网站| brazzers在线观看| 国产精品免费丝袜| 蜜桃视频在线观看91| 国产精品无码天天爽视频| 亚洲欧美日本视频在线观看| 久久综合伊人77777| av永久免费观看| 久久精品色综合| 欧美一区二区三区在线看| 粉嫩虎白女毛片人体| 91九色在线看| 国产精品污网站| 日本在线观看一区| 天堂在线视频免费| 丁香婷婷综合网| 亚洲一区二区三区四区视频| 又色又爽又黄无遮挡的免费视频| 免费在线成人| 久久久久久久国产精品| 日本妇女毛茸茸| 国产精品久久久久久久免费观看| 在线观看国产精品91| 素人fc2av清纯18岁| 日韩mv欧美mv国产网站| 亚洲精品一区二区三区精华液| 在线播放黄色av| 日韩深夜福利网站| 欧美精品tushy高清| 亚洲污视频在线观看| 制服丝袜专区在线| 欧美日韩国产色| 久久久久久久久久久99| jizz一区二区三区| 精品女厕一区二区三区| 久操网在线观看| a级大胆欧美人体大胆666| 亚洲一区二区三区美女| 99国产精品白浆在线观看免费| wwwav在线| 亚洲自拍偷拍网站| 免费观看亚洲视频| 久久大胆人体| 岛国av一区二区三区| 国产又大又硬又粗| 日韩经典一区| 欧美日韩久久一区| 亚洲综合伊人久久| 日韩中文字幕一区二区高清99| 欧美大片在线观看一区| 国产精品成人99一区无码 | 蜜桃视频m3u8在线观看| 黑人精品xxx一区一二区| 国产福利视频在线播放| av在线日韩| 91精品黄色片免费大全| 亚洲成人激情小说| 国产精品丝袜在线播放| 亚洲男人天堂九九视频| 日韩免费成人av| 一区二区三区中文| 亚洲3p在线观看| 日本中文字幕久久| 激情综合色播五月| 国产精品一区视频| 国产在线一二三区| 亚洲欧美偷拍三级| 波多野结衣家庭教师在线播放 | 成人精品aaaa网站| 高潮毛片7777777毛片| 久久这里只精品最新地址| 亚洲综合av一区| 丁香花高清在线观看完整版| 欧美视频免费在线观看| 涩多多在线观看| 日韩欧美中文字幕电影| 日日噜噜噜夜夜爽亚洲精品| 久久久精品一区二区涩爱| 久久精品主播| 亚洲综合一区二区不卡| 玖玖综合伊人| 亚洲国产日韩精品| www.精品在线| 日韩精品导航| 萌白酱国产一区二区| 国产三级av片| 国产一区二区三区黄视频| 久久精品人成| 麻豆tv在线| 日韩欧美一区二区三区久久| 在线观看视频你懂得| 国产探花一区二区| 久久久久成人网| 一区二区精品视频在线观看| 99国产精品99久久久久久| 中文字幕日韩一区二区三区不卡 | 亚洲福利电影网| 亚洲天堂网2018| 欧美女王vk| 亚州av一区二区| 超碰福利在线观看| 国产精品国产三级国产aⅴ原创| 777777av| 超碰精品在线| 另类图片亚洲另类| 亚洲精品国产无码| 91蜜桃视频在线| 国产xxxx振车| 日韩精品一区国产| 日韩在线观看免费| 中文字幕在线播放av| 久久免费美女视频| www.av中文字幕| 91国内精品| 久久福利网址导航| 国产片在线播放| **欧美大码日韩| 午夜精品久久久久久久99热影院| av中文字幕一区二区| 欧洲美女免费图片一区| 亚洲欧美色视频| 亚洲第一福利视频在线| 中文字幕视频观看| 欧美成人国产| 成人毛片网站| 羞羞污视频在线观看| 欧美一区二区三区四区高清| 国产激情无码一区二区三区| 久久国产尿小便嘘嘘| 日韩av不卡播放| 欧美free嫩15| 在线成人一区二区| 夜夜嗨aⅴ一区二区三区| 中文字幕第一区综合| 婷婷丁香激情网| 日韩成人精品一区二区| 国产精品爽爽ⅴa在线观看| 成人亚洲综合天堂| 欧美私人免费视频| 亚洲怡红院在线观看| 国内成人自拍视频| 国产一区二区三区播放| 在线日韩成人| 欧洲s码亚洲m码精品一区| 精品欧美不卡一区二区在线观看| 日本精品一区二区三区高清| 国产又黄又粗的视频| 精品在线免费视频| 国产情侣第一页| 欧美重口另类| 国产精品久久久精品| 调教视频免费在线观看| 日韩免费观看高清完整版在线观看| 久久国产露脸精品国产| 99综合电影在线视频| 欧美牲交a欧美牲交aⅴ免费真 | 亚洲青青一区| 欧美激情视频网站| 天堂中文在线8| 欧美三级日韩在线| 久久久久久天堂| 国产校园另类小说区| 思思久久精品视频| 日韩午夜在线| 亚洲乱码一区二区三区| 国产一区二区三区免费观看在线| 久久久久久久久久久网站| 国产在线一二| 精品久久久网站| 波多野结衣一区二区三区四区| ...xxx性欧美| 特级西西人体wwwww| 另类小说视频一区二区| 91免费黄视频| 日韩中字在线| 久久精品99久久| japansex久久高清精品| 66m—66摸成人免费视频| 永久免费av在线| 亚洲激情自拍图| 97人妻一区二区精品免费视频| 亚洲电影一区二区| 日本二区三区视频| 91小视频在线| 宇都宫紫苑在线播放| 久久av一区| 日韩精品一区二区在线视频| 欧美午夜精彩| 精品免费二区三区三区高中清不卡| 天天综合网站| 97国产成人精品视频| 国产在线观看av| 国产亚洲激情在线| 欧美一区二区公司| 91精品久久久久久久99蜜桃| 久久久久久久亚洲| 日韩欧美成人区| 久久在线视频精品| 自拍偷在线精品自拍偷无码专区| 女人又爽又黄免费女仆| 成人免费视频视频在线观看免费| 一本一道久久a久久综合蜜桃| 久久国产精品毛片| 青青草视频在线免费播放 | 精品这里只有精品| 欧美日本中文| 浴室偷拍美女洗澡456在线| 日本一区二区免费高清| 欧美男人的天堂| 精品精品国产三级a∨在线| 97碰碰视频| 成人综合日日夜夜| 成人精品在线观看| 在线日本欧美| 国产精品久久久久久久电影| 免费看av不卡| 日本成熟性欧美| 亚洲女同志freevdieo| 亚洲97在线观看| free性护士videos欧美| 欧美国产视频日韩| 日韩激情av| 欧美高清激情视频| 黄色在线观看视频网站| 欧美激情精品久久久久久蜜臀 | 国产大片一区二区三区| 美女精品一区二区| 性生活免费在线观看| 免费高清在线视频一区·| 免费黄色一级网站| 日本午夜一区二区| 欧美午夜aaaaaa免费视频| 日本人妖一区二区| 亚洲欧洲日本精品| 国内外成人在线视频| 涩多多在线观看| 成人爽a毛片一区二区免费| 熟妇高潮一区二区| 99精品国产一区二区三区不卡| 亚洲av无码一区二区三区网址| 久久综合色天天久久综合图片| 玖玖爱在线观看| 久久久精品黄色| www.99re6| 亚洲精品videosex极品| 久久久久性色av无码一区二区| 亚洲a一区二区| 老熟妇仑乱一区二区av| 欧美性色黄大片| 国产农村妇女毛片精品久久| 欧美一二三区在线观看| 熟妇高潮一区二区高潮| 国产婷婷色综合av蜜臀av| 成人高清免费观看mv| 久久亚洲国产精品成人av秋霞| 欧美高清另类hdvideosexjaⅴ| 97精品视频在线观看| 免费观看成人性生生活片 | 蜜臀久久99精品久久久久久宅男| 成人免费高清观看| 国产成人精品久久久| 只有精品亚洲| 国产一区再线| 欧美伦理在线视频| 丰满人妻一区二区三区53号 | 午夜精品在线免费观看| 国产麻豆精品theporn| 黑丝av在线播放| 国产校园另类小说区| 成熟的女同志hd| 天天综合色天天综合色h| 中文av免费观看| 亚洲国产高清福利视频| jizz日韩| 国产+人+亚洲| 久久免费资源| 精品国产一区二区三区久久久久久| 日本欧美视频| 国产原创popny丨九色 | 亚洲av人人澡人人爽人人夜夜| 国产人伦精品一区二区| 妺妺窝人体色www在线下载| 色哟哟亚洲精品| 91成人在线免费| 亚洲男人天堂2024| 欧洲在线视频| 成人久久18免费网站图片| 色婷婷av一区二区三区丝袜美腿| 精品少妇人妻av一区二区| 免费看的黄色欧美网站| 国产探花一区二区三区| 中文一区在线播放| 韩国av免费观看| 日韩视频一区二区在线观看| av电影在线观看一区二区三区| 97精品视频在线观看| 日本一区精品视频| 亚洲国产一区二区精品视频| 一区二区激情| 久久久精品人妻一区二区三区| 国产精品日韩精品欧美在线| 9i精品福利一区二区三区| 欧美精品一区二区三区在线播放| 国产美女av在线| 国产精品久久久久9999| 亚洲国产欧美日韩在线观看第一区| www.激情网| 狠狠色狠狠色综合系列| 国产精品久久久久久久av| 色综合色综合色综合| 亚欧洲精品视频| 久久久亚洲影院你懂的| 亚洲开心激情| 国产一区一区三区| 久久国产精品99精品国产| 最新中文字幕av| 色哟哟欧美精品| 日本啊v在线| 欧美在线精品免播放器视频| 神马午夜久久| 欧美二区在线视频| 99国产精品久久| wwwwww国产| 国产亚洲激情在线| 日韩另类视频| 亚洲第一综合| 美女www一区二区| 日本一级片免费| 7777精品伊人久久久大香线蕉经典版下载 | 久久精品波多野结衣| 日韩一区二区三区电影| 中文字幕伦理免费在线视频 | 成人a'v在线播放| 天天天干夜夜夜操| 国产精品美女久久久久久久| 一级α片免费看刺激高潮视频| 日韩在线免费av| 在线免费成人| 黄色网在线视频| 99精品热视频| 手机看片久久久| 中文字幕亚洲第一| av日韩久久| 国产v片免费观看| 91麻豆免费在线观看| 欧美日韩a v| xxx欧美精品| 亚洲专区**| 国产淫片免费看| 国产欧美一区二区精品性| 91久久国语露脸精品国产高跟| 欧美裸体男粗大视频在线观看| 精品av导航| 九九热免费精品视频| 亚洲女性喷水在线观看一区| 懂色av蜜臀av粉嫩av分享吧| 日韩av免费在线看| 欧美好骚综合网| japanese在线观看| 在线观看一区二区视频| 成人免费视屏| 久久免费视频1| 精品亚洲国产成人av制服丝袜| 国产一级做a爱免费视频| 精品视频久久久| 伊人久久精品| 黄色影院一级片| 亚洲欧美一区二区久久| 国产又爽又黄网站亚洲视频123| 国产精品精品久久久| 欧美极品一区二区三区| 加勒比综合在线| 日韩久久免费av| 国产一区二区精品调教| 青青在线视频免费观看| 国产欧美视频一区二区| 亚洲第一天堂网| 国产精品视频成人| 伊人影院久久|