Closed TigerSkinZhang closed 5 years ago
作者,您好,我的activity也是继承了AppCompatActivity ,但是使用了toobar,出现上述错误,有没有什么办法解决
改了您的源码,自己解决了 使用此方法获取activity private static Activity scanForActivity(Context cont) { if (cont == null) return null; else if (cont instanceof Activity) return (Activity) cont; else if (cont instanceof ContextWrapper) return scanForActivity(((ContextWrapper) cont).getBaseContext());
return null;
}
记得当初是为了处理全屏加的判断,你源码自己调最好
<android.support.design.widget.CoordinatorLayout android:id="@+id/tg" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/background_light" android:fitsSystemWindows="true" android:layout_above="@+id/bottom"