2
This commit is contained in:
@@ -187,12 +187,20 @@ public class UIUtils {
|
||||
* @param context 上下文
|
||||
* @return true 已登录;false 未登录(已跳转登录页)
|
||||
*/
|
||||
private static long lastJumpLoginTime = 0L;
|
||||
|
||||
public static boolean checkLoginAndJump(Context context) {
|
||||
if (isLogined()) {
|
||||
return true;
|
||||
}
|
||||
long now = System.currentTimeMillis();
|
||||
if (now - lastJumpLoginTime < 800) {
|
||||
return false;
|
||||
}
|
||||
lastJumpLoginTime = now;
|
||||
Context targetContext = context != null ? context : getContext();
|
||||
Intent intent = new Intent(targetContext, LoginNewActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
if (!(targetContext instanceof Activity)) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user