Firebase错误android无法访问的语句

时间:2016-09-21 08:02:49

标签: java android

选项项目选定区域mFirebaseAuth.signOut();中无法访问的语句错误。

public boolean onOptionsItemSelected(MenuItem item) {
  return super.onOptionsItemSelected(item);
  switch (item.getItemId()) {               
       case R.id.sign_out_menu:
          mFirebaseAuth.signOut();
          Auth.GoogleSignInApi.signOut(mGoogleApiClient);
          mUsername = ANONYMOUS;
          startActivity(new Intent(this, SignInActivity.class));
          return true;
       default:
           return super.onOptionsItemSelected(item);
    }
}

2 个答案:

答案 0 :(得分:1)

删除,

  return super.onOptionsItemSelected(item);

答案 1 :(得分:-1)

在代码的这一行:

return super.onOptionsItemSelected(item);

删除单词“ return”,使您的新行显示如下:

super.onOptionsItemSelected(item);