Пример #1
0
 @Override
 protected void onStart() {
   super.onStart();
   // Only mark screen if the screen is on. onStart() is still called if the app is in the
   // foreground and the screen is off
   // TODO this solution doesn't work if the activity is in the foreground but the lockscreen is on
   if (isScreenOn()) {
     SmsHelper.markSmsSeen(this);
     SmsHelper.markMmsSeen(this);
     NotificationManager.update(this);
   }
 }