List of usage examples for android.view ContextThemeWrapper getBaseContext
public Context getBaseContext()
From source file:com.microsoft.office.integration.test.AbstractTest.java
private boolean isDialog(Activity activity, View decorView) { if (decorView == null || !decorView.isShown()) { return false; }//from ww w . ja v a 2 s . c o m Context viewContext = null; if (decorView != null) { viewContext = decorView.getContext(); } if (viewContext instanceof ContextThemeWrapper) { ContextThemeWrapper ctw = (ContextThemeWrapper) viewContext; viewContext = ctw.getBaseContext(); } Context activityContext = activity; Context activityBaseContext = activity.getBaseContext(); return (activityContext.equals(viewContext) || activityBaseContext.equals(viewContext)) && (decorView != activity.getWindow().getDecorView()); }