Tong
2021-09-01 071085275e07d96eda7f970f158482f0d9a8d4bf
HDL-ON_Android/Other/JPush/JPushOpenClickActivity.cs
@@ -1,19 +1,16 @@
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.Hdl.ON.Jpush.Androidjpush;
namespace JPushSample
using Android.Views;
namespace HDL_ON_Android
{
    [Activity(LaunchMode = Android.Content.PM.LaunchMode.SingleTop,
            Exported = true, Enabled = true, Name = "com.hdl.onpro.JPushOpenClickActivity")]
    [Activity(
            Exported = true, Enabled = true, Name = "com.hdl.onpro.JPushOpenClickActivity"
        , Theme = "@android:style/Theme.Translucent.NoTitleBar", TaskAffinity = ":jpushopenclick")]
    [IntentFilter(new string[] { "com.hdl.onpro.JPushOpenClickActivity", Intent.ActionView },
         Categories = new string[]
        {
@@ -27,31 +24,31 @@
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            View v = new View(this);
            SetContentView(v);
            HandleOpenClick(Intent);
        }
        protected void HandleOpenClick()
        protected void HandleOpenClick(Intent intent)
        {
            Intent intent = new Intent();
            intent.SetAction("com.hdl.onpro.jpush.firm.NOTIFICATION_OPENED");
            Intent broadcastIntent = new Intent();
            broadcastIntent.SetAction("com.hdl.onpro.jpush.firm.NOTIFICATION_OPENED");
            ComponentName componentName = new ComponentName(PackageName, "com.hdl.onpro.JPushFirmBroadcast");
            if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
            {
                intent.SetComponent(componentName);
                broadcastIntent.SetComponent(componentName);
            }
            this.SendBroadcast(intent);
            FirmOpenClickHelper.Instance.HandleOpenClick(this, Intent, intent);
            FirmOpenClickHelper.Instance.HandleOpenClick(this, intent, broadcastIntent);
            Finish();
        }
        protected override void OnNewIntent(Intent intent)
        {
            base.OnNewIntent(intent);
            Intent = intent;
            HandleOpenClick();
            HandleOpenClick(intent);
        }
    }