-4
に
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View fa = getView();
ll = (LinearLayout)inflater.inflate(R.layout.chat_layout, container,false);
//return inflater.inflate(R.layout.chat_layout, container, false);
if (!UtilChat.checkConnection(getActivity())){
UtilChat.initToast(getActivity(), "LOL");
}else{
bindViews();
verificaUsuarioLogado();
mGoogleApiClient = new GoogleApiClient.Builder(getActivity())
.enableAutoManage(getActivity(), this)
.addApi(Auth.GOOGLE_SIGN_IN_API)
.build();
}
return ll;
}
private void bindViews(){
contentRoot = fa.findViewById(R.id.contentRoot);
edMessage = (EmojiconEditText)fa.findViewById(R.id.editTextMessage);
btSendMessage = (ImageView)fa.findViewById(R.id.buttonMessage);
btSendMessage.setOnClickListener(this);
btEmoji = (ImageView)fa.findViewById(R.id.buttonEmoji);
emojIcon = new EmojIconActions(getActivity(),contentRoot,edMessage,btEmoji);
emojIcon.ShowEmojIcon();
rvListMessage = (RecyclerView)fa.findViewById(R.id.messageRecyclerView);
mLinearLayoutManager = new LinearLayoutManager(getActivity());
mLinearLayoutManager.setStackFromEnd(true);
}
エラー変換:あなたはnullオブジェクトにfindViewByIdを呼び出している。ここチャットFirebase断片
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.support.v4.app.FragmentActivity.findViewById(int)' on a null object reference at sky.alien.korenovskguide.ChatActivity.bindViews(ChatActivity.java:381) at sky.alien.korenovskguide.ChatActivity.onCreateView(ChatActivity.java:125)