Fix #422
This commit is contained in:
parent
2bcca4c5c8
commit
cb69d20cfa
|
@ -14,6 +14,7 @@ package app.fedilab.android.fragments;
|
|||
* You should have received a copy of the GNU General Public License along with Fedilab; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
import android.app.NotificationManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
@ -250,6 +251,11 @@ public class DisplayNotificationsFragment extends Fragment implements OnRetrieve
|
|||
swipeRefreshLayout.setEnabled(true);
|
||||
if (context == null)
|
||||
return;
|
||||
if( getUserVisibleHint()){
|
||||
NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
assert mNotificationManager != null;
|
||||
mNotificationManager.cancelAll();
|
||||
}
|
||||
if (getUserVisibleHint() && notifications != null && notifications.size() > 0) {
|
||||
retrieveMissingNotifications(notifications.get(0).getId());
|
||||
updateNotificationLastId(notifications.get(0).getId());
|
||||
|
|
Loading…
Reference in New Issue