Example usage for android.app Activity findViewById

List of usage examples for android.app Activity findViewById

Introduction

In this page you can find the example usage for android.app Activity findViewById.

Prototype

@Nullable
public <T extends View> T findViewById(@IdRes int id) 

Source Link

Document

Finds a view that was identified by the android:id XML attribute that was processed in #onCreate .

Usage

From source file:Main.java

public static View getRootView(Activity act) {
    return act.findViewById(android.R.id.content);
}

From source file:Main.java

public static View getContentView(Activity activity) {
    return activity.findViewById(android.R.id.content);
}

From source file:Main.java

public static View findViewByIdString(Activity a, String s) {
    return a.findViewById(a.getResources().getIdentifier(s, "id", a.getPackageName()));
}

From source file:Main.java

public static View getActivityContentView(Activity activity) {
    return activity.findViewById(android.R.id.content);
}

From source file:Main.java

@SuppressWarnings("unchecked")
public static <T> T findView(int id, Activity activity) {
    return (T) activity.findViewById(id);
}

From source file:Main.java

private static ViewGroup findContentLayout(Activity activity) {
    return (ViewGroup) activity.findViewById(android.R.id.content);
}

From source file:Main.java

public static View getRootView(Activity context) {
    return ((ViewGroup) context.findViewById(android.R.id.content)).getChildAt(0);
}

From source file:Main.java

public static View getView(Activity activity, int rid) {
    return activity.findViewById(rid);
}

From source file:Main.java

public static TextView findTextViewById(int resid, Activity activity) {
    return (TextView) activity.findViewById(resid);
}

From source file:Main.java

public static View getActivityRootView(Activity activity) {
    return ((ViewGroup) activity.findViewById(android.R.id.content)).getChildAt(0);
}