获取最新的activity，如果没有则返回null | Gets the latest activity and returns null if not
@return 最新的activity | Latest activity
15871
private Activity getLastActivityInner(){
        synchronized (LOCK_LASTACTIVITIES) {
            if (curActivities.size() > 0) {
                return curActivities.get(curActivities.size()-1);
            } else {
                return null;
            }
        }
    }
882882
protected final SessionState getSessionState() {
        if (sessionTracker != null) {
            Session currentSession = sessionTracker.getSession();
            return (currentSession != null) ? currentSession.getState() : null;
        }
        return null;
    }
378803
public function toggleActivity()
    {
        if (null !== $response = $this->checkAuth(AdminResources::SALES, [], AccessManager::UPDATE)) {
            return $response;
        }

        try {
            $this->dispatch(
                TheliaEvents::SALE_TOGGLE_ACTIVITY,
                new SaleToggleActivityEvent(
                    $this->getExistingObject()
                )
            );
        } catch (\Exception $ex) {
            // Any error
            return $this->errorPage($ex);
        }

        return $this->nullResponse();
    }
730330
public Query queryActivity() {
        Query q = queryEntitiesRequest(HttpMethod.GET, null, null,
               organizationId, applicationId, "activities");
        return q;
    }
53303
@Nullable
    public final Context getApplicationContext() {
        Activity activity = getActivity();
        return activity != null ? activity.getApplicationContext() : null;
    }
613673
public Object getActivity(ActivityHandle ah) {
	    if (tracer.isFineEnabled()) {
	    	tracer.fine("get Activity with ActivityHandle "+ah.toString());
	    }
	    // if handle exists then recreate activity
	    return activities.get(ah);
	}
153286
@Override
    public void onActivityPause(Activity activity) {
        // 通知hmssdk，activity onPause了
        HuaweiApiClient client = getApiClient();
        if (client != null) {
            client.onPause(activity);
        }
    }
313208
def fetch(self):
        

        entries = []
        for activity in self.activities['entries']:
            entries.append(
                    [element for element in [activity['title'],
                        activity['content'][0]['value']]])

        return entries[0:self.max_entries]
990515
public ActivityHandle getActivityHandle(Object arg0) {
        if (arg0 instanceof HttpClientActivityImpl) {
            HttpClientActivityHandle handle = new HttpClientActivityHandle(
                    ((HttpClientActivityImpl) arg0).getSessionId());
            if (activities.containsKey(handle)) {
                return handle;
            }
        }
        return null;
    }
1326376
@Nullable
    public final Resources getResources() {
        Activity activity = getActivity();
        return activity != null ? activity.getResources() : null;
    }
923421
public String getCurrentAttempt()
	{
		if (currentIndex < words.size())
		{
			final String currentAttempt = words.get(currentIndex);
			return currentAttempt;
		}
		return null;
	}
60539
@Override
    public void onActivityResume(Activity activity) {
        // 通知hmssdk activity onResume了
        HuaweiApiClient client = getApiClient();
        if (client != null) {
            HMSAgentLog.d("tell hmssdk: onResume");
            client.onResume(activity);
        }

        // 如果正在解决错误，则处理被覆盖的场景
        HMSAgentLog.d("is resolving:" + isResolving);
        if (isResolving && !PACKAGE_NAME_HIAPP.equals(curAppPackageName)) {
            if (activity instanceof BridgeActivity) {
                resolveActivity = (BridgeActivity)activity;
                hasOverActivity = false;
                HMSAgentLog.d("received bridgeActivity:" + StrUtils.objDesc(resolveActivity));
            } else if (resolveActivity != null && !resolveActivity.isFinishing()){
                hasOverActivity = true;
                HMSAgentLog.d("received other Activity:" + StrUtils.objDesc(resolveActivity));
            }
            timeoutHandler.removeMessages(UPDATE_OVER_ACTIVITY_CHECK_TIMEOUT_HANDLE_MSG);
            timeoutHandler.sendEmptyMessageDelayed(UPDATE_OVER_ACTIVITY_CHECK_TIMEOUT_HANDLE_MSG, UPDATE_OVER_ACTIVITY_CHECK_TIMEOUT);
        }
    }
571591
public function getActivities()
    {
        if (!isset($this->data['_embedded']['activities'])) {
            return [];
        }

        $activities = [];
        foreach ($this->data['_embedded']['activities'] as $data) {
            $activities[] = new Activity($data, $this->baseUrl, $this->client);
        }

        return $activities;
    }
1170890
public Date getTo() {
        Long to = null;
        for (final TimeInterval interval : intervals) {
            if (to == null) {
                to = interval.getTo();
            } else {
                to = Math.max(interval.getTo(), to);
            }
        }
        if (to != null) {
            return new Date(to);
        }
        return null;
    }
1227376
public static String getStatusForItem(Long lastActivity) {

        if (lastActivity.longValue() < CmsSessionsTable.INACTIVE_LIMIT) {
            return CmsVaadinUtils.getMessageText(Messages.GUI_MESSAGES_BROADCAST_COLS_STATUS_ACTIVE_0);
        }
        return CmsVaadinUtils.getMessageText(Messages.GUI_MESSAGES_BROADCAST_COLS_STATUS_INACTIVE_0);
    }
908973
public ActivityHandle getActivityHandle(Object activity) {
		if (activity instanceof Wrapper) {
			final Wrapper w = (Wrapper) activity;
			if (w.getRa() == this) {
				return w.getActivityHandle();
			}			
		}
		return null;		
	}
1031617
public Set<String> getActivitiesWithDataUsage() {
        Set<String> result = new HashSet<>();
        String propertyValue = getProperty(ProcessContextProperty.ACTIVITIES_WITH_DATA_USAGE);
        if (propertyValue == null) {
            return result;
        }
        StringTokenizer activityTokens = StringUtils.splitArrayString(propertyValue, " ");
        while (activityTokens.hasMoreTokens()) {
            result.add(activityTokens.nextToken());
        }
        return result;
    }