23
23
24
24
import com .automattic .simplenote .analytics .AnalyticsTracker ;
25
25
import com .automattic .simplenote .models .Note ;
26
+ import com .automattic .simplenote .utils .IntentUtils ;
26
27
import com .automattic .simplenote .utils .PrefUtils ;
27
28
import com .simperium .Simperium ;
28
29
import com .simperium .client .Bucket ;
@@ -112,14 +113,14 @@ private void updateWidget(Context context, AppWidgetManager appWidgetManager, in
112
113
113
114
if (user .getStatus ().equals (User .Status .NOT_AUTHORIZED )) {
114
115
// Create intent to navigate to notes activity which redirects to login on widget click
115
- Intent intent = new Intent (context , NotesActivity . class );
116
+ Intent intent = IntentUtils . maybeAliasedIntent (context );
116
117
intent .putExtra (KEY_LIST_WIDGET_CLICK , NOTE_LIST_WIDGET_SIGN_IN_TAPPED );
117
118
intent .setFlags (Intent .FLAG_ACTIVITY_NEW_TASK | Intent .FLAG_ACTIVITY_CLEAR_TOP );
118
119
PendingIntent pendingIntent = PendingIntent .getActivity (context , appWidgetId , intent , PendingIntent .FLAG_IMMUTABLE );
119
120
views .setOnClickPendingIntent (R .id .widget_layout , pendingIntent );
120
121
121
122
// Reset intent to navigate to note editor on note list add button click to navigate to notes activity, which redirects to login/signup
122
- Intent intentButton = new Intent (context , NotesActivity . class );
123
+ Intent intentButton = IntentUtils . maybeAliasedIntent (context );
123
124
views .setOnClickPendingIntent (R .id .widget_button , PendingIntent .getActivity (context , appWidgetId , intentButton , PendingIntent .FLAG_UPDATE_CURRENT | PendingIntent .FLAG_IMMUTABLE ));
124
125
125
126
views .setTextViewText (R .id .widget_text , context .getResources ().getString (R .string .log_in_use_widget ));
@@ -136,7 +137,7 @@ private void updateWidget(Context context, AppWidgetManager appWidgetManager, in
136
137
137
138
if (cursor .getCount () > 0 ) {
138
139
// Create intent to navigate to notes activity on widget click while loading
139
- Intent intentLoading = new Intent (context , NotesActivity . class );
140
+ Intent intentLoading = IntentUtils . maybeAliasedIntent (context );
140
141
intentLoading .putExtra (KEY_LIST_WIDGET_CLICK , NOTE_LIST_WIDGET_TAPPED );
141
142
intentLoading .setFlags (Intent .FLAG_ACTIVITY_NEW_TASK | Intent .FLAG_ACTIVITY_CLEAR_TOP );
142
143
PendingIntent pendingIntentLoading = PendingIntent .getActivity (context , appWidgetId , intentLoading , PendingIntent .FLAG_IMMUTABLE );
@@ -159,7 +160,7 @@ private void updateWidget(Context context, AppWidgetManager appWidgetManager, in
159
160
views .setPendingIntentTemplate (R .id .widget_list , pendingIntentItem );
160
161
161
162
// Create intent to navigate to note editor on note list add button click
162
- Intent intentButton = new Intent (context , NotesActivity . class );
163
+ Intent intentButton = IntentUtils . maybeAliasedIntent (context );
163
164
intentButton .putExtra (KEY_LIST_WIDGET_CLICK , NOTE_LIST_WIDGET_BUTTON_TAPPED );
164
165
intentButton .setFlags (Intent .FLAG_ACTIVITY_NEW_TASK | Intent .FLAG_ACTIVITY_CLEAR_TOP );
165
166
PendingIntent pendingIntentButton = PendingIntent .getActivity (context , appWidgetId , intentButton , PendingIntent .FLAG_UPDATE_CURRENT | PendingIntent .FLAG_IMMUTABLE );
@@ -172,14 +173,14 @@ private void updateWidget(Context context, AppWidgetManager appWidgetManager, in
172
173
views .setViewVisibility (R .id .widget_list , View .VISIBLE );
173
174
} else {
174
175
// Create intent to navigate to notes activity on widget click
175
- Intent intent = new Intent (context , NotesActivity . class );
176
+ Intent intent = IntentUtils . maybeAliasedIntent (context );
176
177
intent .putExtra (KEY_LIST_WIDGET_CLICK , NOTE_LIST_WIDGET_TAPPED );
177
178
intent .setFlags (Intent .FLAG_ACTIVITY_NEW_TASK | Intent .FLAG_ACTIVITY_CLEAR_TOP );
178
179
PendingIntent pendingIntent = PendingIntent .getActivity (context , appWidgetId , intent , PendingIntent .FLAG_IMMUTABLE );
179
180
views .setOnClickPendingIntent (R .id .widget_layout , pendingIntent );
180
181
181
182
// Create intent to navigate to note editor on note list add button click
182
- Intent intentButton = new Intent (context , NotesActivity . class );
183
+ Intent intentButton = IntentUtils . maybeAliasedIntent (context );
183
184
intentButton .putExtra (KEY_LIST_WIDGET_CLICK , NOTE_LIST_WIDGET_BUTTON_TAPPED );
184
185
intentButton .setFlags (Intent .FLAG_ACTIVITY_NEW_TASK | Intent .FLAG_ACTIVITY_CLEAR_TOP );
185
186
PendingIntent pendingIntentButton = PendingIntent .getActivity (context , appWidgetId , intentButton , PendingIntent .FLAG_UPDATE_CURRENT | PendingIntent .FLAG_IMMUTABLE );
0 commit comments