From 44ba605a4e850efa757020da5fb4cf02bdf6e3ab Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期一, 08 九月 2025 10:55:18 +0800
Subject: [PATCH] 2025年09月08日10:55:15
---
app/src/main/java/com/hdl/photovoltaic/utils/AppManagerUtils.java | 27 +++++++++++++++++++++++----
1 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/utils/AppManagerUtils.java b/app/src/main/java/com/hdl/photovoltaic/utils/AppManagerUtils.java
index 7429be0..b04e5bc 100644
--- a/app/src/main/java/com/hdl/photovoltaic/utils/AppManagerUtils.java
+++ b/app/src/main/java/com/hdl/photovoltaic/utils/AppManagerUtils.java
@@ -115,6 +115,26 @@
}
/**
+ * Activity鏄惁鍦ㄩ《閮�
+ */
+ public boolean existsTopActivity(Class<?>... args) {
+ try {
+ if (activityStack == null || activityStack.size() == 0) {
+ return false;
+ }
+ final int index = activityStack.size() - 1;
+ for (Class<?> cls : args) {
+ if (activityStack.get(index).getClass().equals(cls)) {
+ return true;
+ }
+ }
+ } catch (Exception e) {
+ return false;
+ }
+ return false;
+ }
+
+ /**
* 鎸囧畾涓�涓被鍚�,浠庢寚瀹氱被鍚嶅紑濮嬬Щ闄ゅ悗闈㈡墍鏈堿ctivity
*
* @param className Activity-绫诲悕(activity.getClass().getName())
@@ -154,7 +174,7 @@
}
- public boolean existsActivity(Context activity,String className){
+ public boolean existsActivity(Context activity, String className) {
boolean isLoginActivity = false;
// 鑾峰彇褰撳墠Activity鐨勫垪琛�
ActivityManager activityManager = (ActivityManager) activity.getSystemService(Context.ACTIVITY_SERVICE);
@@ -168,8 +188,9 @@
break;
}
}
- return isLoginActivity;
+ return isLoginActivity;
}
+
/**
* 缁撴潫鎵�鏈堿ctivity
@@ -208,8 +229,6 @@
}
return null;
}
-
-
/**
--
Gitblit v1.8.0