Page 929 - 3-2
P. 929
spark = notSpark[1];
gas = notGas[1];
temp = notTemp[1];
listItem.add(new ListItem(detector, addr, room, fire,
spark, gas, temp));
Log.d(this.getClass().getName(), ("2 번: " + addr +
" 호"));
Intent intent = new Intent(getApplicationContext(),
MainActivity.class);
PendingIntent pIntent = PendingIntent.getActivity
(getApplicationContext()
, 0
, intent
, PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(pIntent);
manager.notify(1, builder.build());
}
if(notFire[2].equals("1")) {
NotificationManager manager = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
NotificationCompat.Builder builder = new
NotificationCompat.Builder(getApplicationContext());
builder.setSmallIcon(R.drawable.on)
.setTicker("HETT")
.setContentTitle(notAddr[2]+" 호 "+disRoom[2]+
" 에서 불이났습니다!")
.setContentText(" 도망가세요!")
.setDefaults(Notification.DEFAULT_SOUND |
Notification.DEFAULT_LIGHTS |
Notification.DEFAULT_VIBRATE)
.setAutoCancel(true); // 알림바에서 자동 삭제
// autoCancel: 한번 누르면 알림바에서 사라진다.
textAl = " 불남";
detector = "3";
addr = notAddr[2];
room = notRoom[2];
fire = notFire[2];
spark = notSpark[2];
gas = notGas[2];
temp = notTemp[2];
listItem.add(new ListItem(detector, addr, room, fire,
spark, gas, temp));
Log.d(this.getClass().getName(), ("3 번: " + addr +
" 호"));
- 929 -