From 002bb6950a15e703e2ad6ef7b2b4c5d80c4ee64b Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期一, 22 三月 2021 17:56:07 +0800
Subject: [PATCH] 2021-3-22-2
---
HDL-ON_Android/Other/JPush/JPushReceiver.cs | 41 +++++++++++++++++++++++++++++------------
1 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/HDL-ON_Android/Other/JPush/JPushReceiver.cs b/HDL-ON_Android/Other/JPush/JPushReceiver.cs
index 86c19ae..ff8a03b 100644
--- a/HDL-ON_Android/Other/JPush/JPushReceiver.cs
+++ b/HDL-ON_Android/Other/JPush/JPushReceiver.cs
@@ -1,4 +1,5 @@
锘�
+using System;
using Android.Content;
using CN.Jpush.Android.Api;
using CN.Jpush.Android.Service;
@@ -30,7 +31,8 @@
/// <param name="notificationMessage"></param>
public override void OnNotifyMessageOpened(Context context, NotificationMessage notificationMessage)
{
- base.OnNotifyMessageOpened(context, notificationMessage);
+ //2020-12-23 瑙e喅鐐瑰嚮閫氱煡鏍忔墦寮�涓嶄簡APP闂
+ //base.OnNotifyMessageOpened(context, notificationMessage);
OpenNotification(context, notificationMessage);
}
@@ -164,26 +166,41 @@
Utlis.WriteLine("PushMes title : " + pushMes.Title);
Utlis.WriteLine("PushMes message : " + pushMes.Content);
Utlis.WriteLine("PushMes extras : " + pushMes.Extras);
-
- if (Shared.Application.Activity == null)
+ Shared.Application.RunOnMainThread(() =>
{
- var tempIntent = new Intent(context, typeof(Shared.BaseActivity));//Intent intent=new Intent( 璧峰缁勪欢瀵硅薄 , 鐩爣 Service.class);
- tempIntent.SetFlags(ActivityFlags.BroughtToFront);
- context.StartActivity(tempIntent);
+ Intent i = new Intent(context, typeof(BaseActivity));//Intent intent=new Intent( 璧峰缁勪欢瀵硅薄 , 鐩爣 Service.class);
+ i.SetFlags(ActivityFlags.NewTask);
+ context.StartActivity(i);
HDLCommon.Current.AdjustPushMessage(pushMes);
- }
- else
- {
- (Shared.Application.Activity as BaseActivity).MoveToFront();
+ });
- HDLCommon.Current.AdjustPushMessage(pushMes);
- }
+ //Shared.Application.RunOnMainThread(() =>
+ //{
+ // if (Shared.Application.Activity == null)
+ // {
+ // var tempIntent = new Intent(context, typeof(Shared.BaseActivity));//Intent intent=new Intent( 璧峰缁勪欢瀵硅薄 , 鐩爣 Service.class);
+ // tempIntent.SetFlags(ActivityFlags.BroughtToFront);
+ // context.StartActivity(tempIntent);
+
+ // HDLCommon.Current.AdjustPushMessage(pushMes);
+ // }
+ // else
+ // {
+
+ // (Shared.Application.Activity as BaseActivity).MoveToFront();
+ // HDLCommon.Current.AdjustPushMessage(pushMes);
+ // }
+ //});
}
catch
{
}
+ //catch (Exception ex)
+ //{
+ // Utlis.WriteLine(ex.ToString());
+ //}
}
}
--
Gitblit v1.8.0