调用时出现以下异常:
requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
2089-2089/? E/ActivityThread﹕ Service com.android.email.service.EmailBroadcastProcessorService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@10bbc6d8 that was originally bound here
android.app.ServiceConnectionLeaked: Service com.android.email.service.EmailBroadcastProcessorService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@10bbc6d8 that was originally bound here`
我的onCreate方法如下所示:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
setContentView(R.layout.activity_movie_detail);
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}
我甚至不知道从哪里开始。有人有什么想法吗?
另外,只是为了澄清删除requestWindowFeature
行时不会发生异常。
答案 0 :(得分:1)
requestWindowFeature
应该是:
supportRequestWindowFeature
虽然可能存在其他一些潜在问题,但我不明白为什么会出现错误。如果在其他地方使用appcompat主题时使用非支持方法代替支持方法,也会给出相同的错误