Find the specific view from the activity.
Returning value type is bound to your variable type.

@param activity the activity.
@param id the view id.
@param <V> the view class type parameter.
@return the view, null if not found.
169835
@SuppressWarnings("unchecked") // we know that return value type is a child of view, and V is bound to a child of view.
    public static <V extends View> V findViewById(Activity activity, int id) {
        return (V) activity.findViewById(id);
    }
589340
@Nullable
  public final synchronized Object getAttribute(String view, String attribute) {
    if (attributes == null) {
      return null;
    }
    return attributes.get(view, attribute);
  }
3532
public Addon getAddon(final AddonView view, final AddonId id)
   {
      Assert.notNull(view, "AddonView must not be null.");
      Assert.notNull(id, "AddonId must not be null.");
      return lock.performLocked(LockMode.WRITE, new Callable<Addon>()
      {
         @Override
         public Addon call() throws Exception
         {
            Addon result = null;

            for (Addon addon : getAddons(view))
            {
               if (id.equals(addon.getId()))
               {
                  result = addon;
                  break;
               }
            }

            if (result == null)
            {
               result = stateManager.getAddonForView(view, id);
               if (result == null)
                  result = new AddonImpl(stateManager, id);

               Set<Addon> addons = _getAddonsForView(view);
               addons.add(result);
            }

            return result;
         }

      });
   }
394518
@SuppressWarnings("unchecked")
    public <V> V v(Object id) {
        Iterator<Vertex> it = graph.vertices(id);
        return it.hasNext() ? frame(it.next()) : null;
    }
685465
public Operation getOperation(String id) {
        for (Iterator<Operation> it = operations.iterator(); it.hasNext();) {
            Operation oper = it.next();
            if (oper.getId().compareTo(id) == 0) {
                return oper;
            }
        }
        return null;
    }
320043
@SuppressLint("InflateParams")
    private View inflateLayout(final Activity activity) {
        LayoutInflater inflater = activity.getLayoutInflater();
        View view = inflater.inflate(R.layout.remove_preference_header_dialog, null);
        setView(view);
        return view;
    }
1098155
protected View getView(String viewName) {
        for (View view: solo.getCurrentViews()) {
            if (view.toString().contains(viewName)) {
                return view;
            }
        }

        return null;
    }
372223
@Override
    public View resolveView(String viewId, RequestContext context) {
        View view = super.resolveView(viewId, context);
        if (view != null) {
            return view;
        }

        for (final FlowViewResolver flowViewResolver : this.flowViewResolvers) {
            try {
                final String viewIdByConvention = flowViewResolver.getViewIdByConvention(viewId);
                view = flowViewResolver.resolveView(viewIdByConvention, context);
                if (view != null) {
                    return view;
                }
            } catch (Exception e) {
                IllegalStateException ise =
                        new IllegalStateException(
                                "Exception resolving view with name '" + viewId + "'");
                ise.initCause(e);
                throw ise;
            }
        }

        return null;
    }
552629
public boolean waitForView(int id){
		if(config.commandLogging){
			Log.d(config.commandLoggingTag, "waitForView("+id+")");
		}
		
		return waitForView(id, 0, Timeout.getLargeTimeout(), true);
	}
916929
@Nullable
    private static View getEmptyView(@Nullable View rootView) {
        if (rootView == null) {
            throw new RuntimeException("A null rootView was passed to getEmptyView, but Hits/RefinementList require one.");
        }
        return rootView.findViewById(android.R.id.empty);
    }
686983
@Override
    public T getById(Object id)
    {
        return context.getFramed().getFramedVertex(this.type, id);
    }
1330316
public Object requestGet(final String id, Class type) throws SDKException {
    String url = this.pathUrl;
    if (id != null) {
      url += "/" + id;
      return requestGetWithStatus(url, null, type);
    } else {
      return requestGetAll(url, type, null);
    }
  }
201275
public static ShareableResource get(Model mo, String id) {
    return (ShareableResource) mo.getView(VIEW_ID_BASE + id);
  }
101907
@CheckForNull
    public Descriptor<T> findByName(String id) {
        for (Descriptor<T> d : this)
            if(d.getId().equals(id))
                return d;
        return null;
    }
1186756
public Addon getAddonForView(final AddonView view, final AddonId id)
   {
      return lock.performLocked(LockMode.READ, new Callable<Addon>()
      {
         @Override
         public Addon call() throws Exception
         {
            for (AddonVertex vertex : getCurrentGraph().getGraph().vertexSet())
            {
               if (vertex.getAddonId().equals(id) && vertex.getViews().contains(view))
               {
                  return vertex.getAddon();
               }
            }
            return null;
         }
      });
   }
706009
@javax.annotation.Nullable
  synchronized ViewData getView(View.Name viewName, Clock clock, State state) {
    MutableViewData view = getMutableViewData(viewName);
    return view == null ? null : view.toViewData(clock.now(), state);
  }
1081380
@Override
    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
    public View onActivityCreateView(View parent, View view, String name, Context context, AttributeSet attrs) {
        return mCalligraphyFactory.onViewCreated(createCustomViewInternal(parent, view, name, context, attrs), context, attrs);
    }