List of usage examples for android.content ContextWrapper getBaseContext
public Context getBaseContext()
From source file:org.opensilk.video.util.Utils.java
public static Activity findActivity(Context context) { if (context instanceof Activity) { return (Activity) context; } else if (context instanceof ContextWrapper) { ContextWrapper contextWrapper = (ContextWrapper) context; return findActivity(contextWrapper.getBaseContext()); } else {//from w w w . j a va 2s .c om throw new AssertionError("Unknown context type " + context.getClass().getName()); } }