Android 结合AlarmManager浅谈Intent和PendingIntent(3)

// 以下仅是为了演示PendingIntent几个常量的区别
    PendingIntent StopPendIntent1 = PendingIntent.getBroadcast(
      getApplicationContext(), REQUEST_CODE_1, intent,
      PendingIntent.FLAG_UPDATE_CURRENT);
    Log.e("FLAG_UPDATE_CURRENT-->StopPendIntent1:", StopPendIntent1
      + "");
    alarmMgr.cancel(StopPendIntent1);

PendingIntent StopPendIntent11 = PendingIntent.getBroadcast(
      getApplicationContext(), REQUEST_CODE_1, intent,
      PendingIntent.FLAG_NO_CREATE);
    Log.e("FLAG_NO_CREATE------->StopPendIntent11:",
      StopPendIntent11 + "");
    alarmMgr.cancel(StopPendIntent11);

PendingIntent StopPendIntent12 = PendingIntent.getBroadcast(
      getApplicationContext(), REQUEST_CODE_1, intent,
      PendingIntent.FLAG_CANCEL_CURRENT);
    Log.e("FLAG_CANCEL_CURRENT-->StopPendIntent12:",
      StopPendIntent12 + "");
    alarmMgr.cancel(StopPendIntent12);

PendingIntent StopPendIntent13 = PendingIntent.getBroadcast(
      getApplicationContext(), REQUEST_CODE_1, intent,
      PendingIntent.FLAG_ONE_SHOT);
    Log.e("FLAG_ONE_SHOT-------->StopPendIntent13:",
      StopPendIntent13 + "");
    alarmMgr.cancel(StopPendIntent13);
   }
  });
 }
}

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/a1e0f957efea847cb1650bd60dab5065.html