close
需匯入函式庫▼


主要函式部份▼


結果展示▼




程式碼▼

protected void showNotification(double BMI){
NotificationManager barManager=(NotificationManager)getSystemService(NOTIFICATION_SERVICE);
Notification barMsg=new Notification(R.drawable.icon,"歐,你過重囉!",System.currentTimeMillis());

PendingIntent contentIntent = PendingIntent.getActivity(
this,
0,
new Intent(this,BMI.class),
PendingIntent.FLAG_UPDATE_CURRENT);

barMsg.setLatestEventInfo(
Report.this,
"你的BMI值過高",
"通知監督人",
contentIntent
);
barManager.notify(0,barMsg);
}
arrow
arrow
    全站熱搜

    rexra 發表在 痞客邦 留言(0) 人氣()