我将appcompat-v7更新为棒棒糖版(21.0.0)
然后我无法隐藏ActionBar以及以前的工作风格.
<style name="AppTheme.NoActionBar">
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
</style>
Run Code Online (Sandbox Code Playgroud)
我将其设置为特定活动.
<activity android:name=".NoActionBarActivity"
android:theme="@style/AppTheme.NoActionBar"/>
Run Code Online (Sandbox Code Playgroud)
当我使用appcompat-v7 20.0.0版本时,操作栏将按预期隐藏.
如何使用AppCompat版本21库隐藏自定义样式的操作栏?
MainActivity有一个NavigationDrawer,每个导航菜单都会带来Fragment而不是新的Activity.
有设置片段,如果我更改导航菜单的顺序,它应立即反映到NavigationDrawerFragment.
我在SettingsFragment中发布了事件,但它没有出现在NavigationDrawerFragment上.
我做了一个AndroidBus扩展总线
public class AndroidBus extends Bus {
private final Handler mainThread = new Handler(Looper.getMainLooper());
public AndroidBus() {
super(ThreadEnforcer.ANY);
}
@Override
public void post(final Object event) {
if (BuildConfig.DEBUG) Ln.d("BUS: SYNC current thread="+Thread.currentThread().getName()+", post=" + event + " bus=" + this);
if (Looper.myLooper() == Looper.getMainLooper()) {
super.post(event);
} else {
mainThread.post(new Runnable() {
@Override
public void run() {
post(event);
}
});
}
}
@Override
public void register(Object object) {
super.register(object);
if (BuildConfig.DEBUG) Ln.d("BUS: SYNC current thread="+Thread.currentThread().getName()+", register=" + …Run Code Online (Sandbox Code Playgroud)