Get an instance of {@code RxLoaderManager} that is tied to the lifecycle of the given {@link
android.support.v4.app.FragmentActivity}.

@param activity the activity
@return the {@code RxLoaderManager}
966347
public static RxLoaderManager get(FragmentActivity activity) {
        RxLoaderBackendFragmentCompat manager = (RxLoaderBackendFragmentCompat) activity.getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG);
        if (manager == null) {
            manager = new RxLoaderBackendFragmentCompat();
            activity.getSupportFragmentManager().beginTransaction().add(manager, FRAGMENT_TAG).commit();
        }
        return new RxLoaderManager(manager);
    }
690448
protected static ActivityManager.MemoryInfo getMemInfo(Context ctx) {
        try {
            ActivityManager actManager = (ActivityManager) ctx.getSystemService(ACTIVITY_SERVICE);
            ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo();
            actManager.getMemoryInfo(memInfo);
            return memInfo;
        } catch (Exception e) {
            Log.e(TAG, "Error getting MemoryInfo.", e);
            return null;
        }
    }
1212108
public static LoaderPipe getPipe(String name, Activity activity) {
        Pipe pipe = pipes.get(name);
        LoaderAdapter adapter = new LoaderAdapter(activity, pipe, name);
        adapter.setLoaderIds(loaderIdsForNamed);
        return adapter;
    }
168471
public static MortarScope getScope(Context context) {
    //noinspection ResourceType
    Object scope = context.getSystemService(MORTAR_SERVICE);
    if (scope == null) {
      // Essentially a workaround for the lifecycle interval where an Activity's
      // base context is not yet set to the Application, but the Application
      // context is available and contains a MortarScope that provides needed
      // services. Thanks, Android!

      //noinspection ResourceType
      scope = context.getApplicationContext().getSystemService(MORTAR_SERVICE);
    }
    return (MortarScope) scope;
  }
1026613
private I_CmsWorkplaceAction getAction(VaadinRequest request) throws Exception {

        String dialogId = getDialogId(request);
        @SuppressWarnings("unchecked")
        Class<I_CmsWorkplaceAction> actionClass = (Class<I_CmsWorkplaceAction>)getClass().getClassLoader().loadClass(
            dialogId);
        return actionClass.newInstance();
    }
558331
public T get(GVRAndroidResource androidResource) {
        WeakReference<T> reference = cache.get(androidResource);
        if (reference == null) {
            // Not in map
            // Log.d(TAG, "get(%s) returning %s", androidResource, null);
            return null;
        }
        T cached = reference.get();
        if (cached == null) {
            // In map, but not in memory
            cache.remove(androidResource);
        } else {
            // No one will ever read this stream
            androidResource.closeStream();
        }
        // Log.d(TAG, "get(%s) returning %s", androidResource, cached);
        return cached;
    }
1109357
private void processActivity(Activity activity)
   {
      Task task = getParentTask(activity).addTask();
      task.setText(1, activity.getId());

      task.setActualDuration(activity.getActualDuration());
      task.setActualFinish(activity.getActualFinish());
      task.setActualStart(activity.getActualStart());
      //activity.getBaseunit()
      //activity.getBilled()
      //activity.getCalendar()
      //activity.getCostAccount()
      task.setCreateDate(activity.getCreationTime());
      task.setFinish(activity.getCurrentFinish());
      task.setStart(activity.getCurrentStart());
      task.setName(activity.getDescription());
      task.setDuration(activity.getDurationAtCompletion());
      task.setEarlyFinish(activity.getEarlyFinish());
      task.setEarlyStart(activity.getEarlyStart());
      task.setFreeSlack(activity.getFreeFloat());
      task.setLateFinish(activity.getLateFinish());
      task.setLateStart(activity.getLateStart());
      task.setNotes(activity.getNotes());
      task.setBaselineDuration(activity.getOriginalDuration());
      //activity.getPathFloat()
      task.setPhysicalPercentComplete(activity.getPhysicalPercentComplete());
      task.setRemainingDuration(activity.getRemainingDuration());
      task.setCost(activity.getTotalCost());
      task.setTotalSlack(activity.getTotalFloat());
      task.setMilestone(activityIsMilestone(activity));
      //activity.getUserDefined()
      task.setGUID(activity.getUuid());

      if (task.getMilestone())
      {
         if (activityIsStartMilestone(activity))
         {
            task.setFinish(task.getStart());
         }
         else
         {
            task.setStart(task.getFinish());
         }
      }

      if (task.getActualStart() == null)
      {
         task.setPercentageComplete(Integer.valueOf(0));
      }
      else
      {
         if (task.getActualFinish() != null)
         {
            task.setPercentageComplete(Integer.valueOf(100));
         }
         else
         {
            Duration remaining = activity.getRemainingDuration();
            Duration total = activity.getDurationAtCompletion();
            if (remaining != null && total != null && total.getDuration() != 0)
            {
               double percentComplete = ((total.getDuration() - remaining.getDuration()) * 100.0) / total.getDuration();
               task.setPercentageComplete(Double.valueOf(percentComplete));
            }
         }
      }

      m_activityMap.put(activity.getId(), task);
   }
10278
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
    public static UserManager getUserManager(Context context) {
        return (UserManager) context.getSystemService(Context.USER_SERVICE);
    }
905233
public Observable<ServiceResponse<DeploymentLocationsInner>> getSubscriptionDeploymentLocationsWithServiceResponseAsync() {
        if (this.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null.");
        }
        if (this.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null.");
        }
        return service.getSubscriptionDeploymentLocations(this.subscriptionId(), this.apiVersion(), this.acceptLanguage(), this.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<DeploymentLocationsInner>>>() {
                @Override
                public Observable<ServiceResponse<DeploymentLocationsInner>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<DeploymentLocationsInner> clientResponse = getSubscriptionDeploymentLocationsDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
133878
@Override
    public ConsumerManager getConsumerManager()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "getConsumerManager");

        ConsumerManager manager = (ConsumerManager) getOutputHandler();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "getConsumerManager", manager);
        return manager;
    }
298681
public I_CmsResourceLoader getLoader(CmsResource resource) throws CmsLoaderException {

        return getLoader(getResourceType(resource.getTypeId()).getLoaderId());
    }
296571
public final UserManagedCacheBuilder<K, V, T> withClassLoader(ClassLoader classLoader) {
    if (classLoader == null) {
      throw new NullPointerException("Null classloader");
    }
    UserManagedCacheBuilder<K, V, T> otherBuilder = new UserManagedCacheBuilder<>(this);
    otherBuilder.classLoader = classLoader;
    return otherBuilder;
  }
1229207
@ManyToOne(targetEntity = org.openprovenance.prov.sql.QualifiedName.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "ACTIVITY")
    public org.openprovenance.prov.model.QualifiedName getActivity() {
        return activity;
    }
144538
public static AndroidLifecycleScopeProvider from(
      LifecycleOwner owner, Lifecycle.Event untilEvent) {
    return from(owner.getLifecycle(), untilEvent);
  }
439927
@SuppressWarnings({ "rawtypes", "unchecked" })
  public <T extends AbstractActivityBuilder> T multiInstanceDone() {
    return (T) ((Activity) element.getParentElement()).builder();
  }
780495
public DrawerBuilder withHeader(@LayoutRes int headerViewRes) {
        if (mActivity == null) {
            throw new RuntimeException("please pass an activity first to use this call");
        }

        if (headerViewRes != -1) {
            //i know there should be a root, bit i got none here
            this.mHeaderView = mActivity.getLayoutInflater().inflate(headerViewRes, null, false);
        }

        return this;
    }
704781
public ActivityInstance getActivityInstance(Long pActivityInstId)
    throws ProcessException, DataAccessException {
        TransactionWrapper transaction=null;
        try {
            transaction = startTransaction();
            return engineImpl.getDataAccess().getActivityInstance(pActivityInstId);
        } catch (DataAccessException e) {
            if (canRetryTransaction(e)) {
                transaction = (TransactionWrapper)initTransactionRetry(transaction);
                return ((ProcessExecutor)getTransactionRetrier()).getActivityInstance(pActivityInstId);
            }
            else
                throw e;
        } catch (SQLException e) {
            if (canRetryTransaction(e)) {
                transaction = (TransactionWrapper)initTransactionRetry(transaction);
                return ((ProcessExecutor)getTransactionRetrier()).getActivityInstance(pActivityInstId);
            }
            else
                throw new ProcessException(0, "Failed to get activity instance", e);
        } finally {
            stopTransaction(transaction);
        }
    }