This commit is contained in:
Juan Miguel Boyero Corral 2015-09-19 22:47:20 +02:00
parent 4b3ac868f5
commit 020935811d
3 changed files with 24 additions and 11 deletions

View File

@ -126,7 +126,8 @@
<activity
android:name="es.ugr.swad.swadroid.modules.notifications.Notifications"
android:label="@string/notificationsModuleLabel"
android:parentActivityName="es.ugr.swad.swadroid.SWADMain" >
android:parentActivityName="es.ugr.swad.swadroid.SWADMain"
android:exported="true">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="es.ugr.swad.swadroid.SWADMain" />

View File

@ -39,7 +39,6 @@ import android.widget.AbsListView;
import android.widget.ExpandableListView;
import android.widget.ExpandableListView.OnChildClickListener;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
@ -55,7 +54,6 @@ import es.ugr.swad.swadroid.R;
import es.ugr.swad.swadroid.SWADroidTracker;
import es.ugr.swad.swadroid.database.DataBaseHelper;
import es.ugr.swad.swadroid.gui.AlertNotificationFactory;
import es.ugr.swad.swadroid.gui.SwipeListViewTouchListener;
import es.ugr.swad.swadroid.model.Model;
import es.ugr.swad.swadroid.model.SWADNotification;
import es.ugr.swad.swadroid.modules.Login;
@ -493,10 +491,17 @@ public class Notifications extends Module implements
@Override
protected void postConnect() {
Notification notif;
PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(),
0,
new Intent(this, Notifications.class),
Intent.FLAG_ACTIVITY_NEW_TASK);
Intent notificationIntent = new Intent(this, Notifications.class);
PendingIntent pendingIntent;
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//single top to avoid creating many activity stacks queue
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
pendingIntent = PendingIntent.getActivity(getApplicationContext(),
0,
notificationIntent,
PendingIntent.FLAG_CANCEL_CURRENT);
if (!SyncUtils.isSyncAutomatically(getApplicationContext())) {
if (notifCount > 0) {

View File

@ -424,10 +424,17 @@ public class NotificationsSyncAdapterService extends Service {
throws Exception {
Notification notif;
PendingIntent pendingIntent = PendingIntent.getActivity(context,
0,
new Intent(context, Notifications.class),
Intent.FLAG_ACTIVITY_NEW_TASK);
Intent notificationIntent = new Intent(context, Notifications.class);
PendingIntent pendingIntent;
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//single top to avoid creating many activity stacks queue
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
pendingIntent = PendingIntent.getActivity(context,
0,
notificationIntent,
PendingIntent.FLAG_CANCEL_CURRENT);
//Notify synchronization start
Intent startIntent = new Intent();