From d81e5e83f6b2a6f46279859c3e9d739491f45c48 Mon Sep 17 00:00:00 2001 From: YoloMao Date: Wed, 13 Jul 2022 09:59:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20findPage=20getTitle()=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=9D=9E=E7=A9=BA=E5=88=A4=E6=96=AD=20(#164)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix title default not blank Co-authored-by: shenliming <348515494@qq.com> --- .../sdk/autotrack/inject/ViewClickProvider.java | 1 - .../android/sdk/autotrack/page/PageProvider.java | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/growingio-autotracker-core/src/main/java/com/growingio/android/sdk/autotrack/inject/ViewClickProvider.java b/growingio-autotracker-core/src/main/java/com/growingio/android/sdk/autotrack/inject/ViewClickProvider.java index e604b222..9067cb34 100644 --- a/growingio-autotracker-core/src/main/java/com/growingio/android/sdk/autotrack/inject/ViewClickProvider.java +++ b/growingio-autotracker-core/src/main/java/com/growingio/android/sdk/autotrack/inject/ViewClickProvider.java @@ -46,7 +46,6 @@ public static void viewOnClick(View view) { // 为了防止click事件重复发送 if (ClassUtil.isDuplicateClick(view)) { - view.hasOnClickListeners(); Logger.e(TAG, "Duplicate Click"); return; } diff --git a/growingio-autotracker-core/src/main/java/com/growingio/android/sdk/autotrack/page/PageProvider.java b/growingio-autotracker-core/src/main/java/com/growingio/android/sdk/autotrack/page/PageProvider.java index 487764b5..fa344b1d 100644 --- a/growingio-autotracker-core/src/main/java/com/growingio/android/sdk/autotrack/page/PageProvider.java +++ b/growingio-autotracker-core/src/main/java/com/growingio/android/sdk/autotrack/page/PageProvider.java @@ -486,13 +486,16 @@ public Page findPage(View view) { return ALL_PAGE_TREE.get(activity); } else { //一般不会进入,如果出现则新生成page返回 + //如穿山甲广告:会自己生成一个ActivityWrapper做代理并自己控制生命周期导致sdk的page无法命中,具体类为:PluginFragmentActivityWrapper ActivityPage newPage = new ActivityPage(activity); - newPage.setTitle(activity.getTitle().toString()); + if (!TextUtils.isEmpty(activity.getTitle())) { + newPage.setTitle(activity.getTitle().toString()); + } else { + newPage.setTitle("WrapperActivity"); + } return newPage; } } - - // TODO: 2020/6/10 这种情况需要观察 - throw new NullPointerException("Page is NULL"); + return null; } }