Navigate to unified inbox from notification or widget

pull/146/head
M66B 6 years ago
parent b0eeff6846
commit 203fcc1eba

@ -359,16 +359,21 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
Intent intent = getIntent();
String action = intent.getAction();
Log.i(Helper.TAG, "View intent=" + intent + " action=" + action);
if (action != null && action.startsWith("thread")) {
if (action != null) {
intent.setAction(null);
setIntent(intent);
if ("unified".equals(action))
getSupportFragmentManager().popBackStack("unified", 0);
else if (action.startsWith("thread")) {
ViewModelMessages model = ViewModelProviders.of(this).get(ViewModelMessages.class);
model.setMessages(null);
intent.putExtra("thread", action.split(":", 2)[1]);
onViewThread(intent);
}
}
if (getIntent().hasExtra(Intent.EXTRA_PROCESS_TEXT)) {
String search = getIntent().getCharSequenceExtra(Intent.EXTRA_PROCESS_TEXT).toString();

@ -384,6 +384,7 @@ public class ServiceSynchronize extends LifecycleService {
// Build pending intent
Intent view = new Intent(this, ActivityView.class);
view.setAction("unified");
view.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent piView = PendingIntent.getActivity(
this, ActivityView.REQUEST_UNIFIED, view, PendingIntent.FLAG_UPDATE_CURRENT);

@ -47,6 +47,7 @@ public class Widget extends AppWidgetProvider {
private static void update(int[] appWidgetIds, AppWidgetManager appWidgetManager, Context context, int count) {
Intent intent = new Intent(context, ActivityView.class);
intent.setAction("unified");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent pi = PendingIntent.getActivity(context, ActivityView.REQUEST_UNIFIED, intent, PendingIntent.FLAG_UPDATE_CURRENT);
for (int id : appWidgetIds) {

Loading…
Cancel
Save