protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_screen_on);
mTxtView = (TextView) findViewById(R.id.textView1);
mNM = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
PendingIntent mPendingIntent = PendingIntent.getActivity(
getApplicationContext(), 0, new Intent(getApplicationContext(),
ScreenOnActivity.class),
PendingIntent.FLAG_UPDATE_CURRENT);
mNoti = new NotificationCompat.Builder(getApplicationContext())
.setContentTitle("화면 항상 켜기")
.setContentText("화면 항상 켜기가 실행 중입니다!")
.setSmallIcon(R.drawable.ic_launcher)
.setTicker("알림!!!")
.setAutoCancel(true)
.setContentIntent(mPendingIntent)
.build();
}
@Override
protected void onPause() {
super.onPause();
if (isServiceOn == true) {
mNM.notify(7777, mNoti);
}
}
'JAVA code' 카테고리의 다른 글
Math.ceil, Math.floor,Math.round (0) | 2016.04.11 |
---|---|
Date (0) | 2014.10.04 |