android findViewById is null in LinearLayout

Home / Uncategorized / android findViewById is null in LinearLayout

Question:
android findViewById method return value is null

this view is custom class

view.xml

view activity java (Fragment)
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
final ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.view, container, false);

mBefore = (MemberBeforeLoginView)rootView.findViewById(R.id.view_before_login);
mAfter = (MemberAfterLoginView)rootView.findViewById(R.id.view_after_login);

mBefore.SetStateListener(this);
mAfter.SetStateListener(this);

route();

return rootView;
}

inside xml is view_mypage_before_login.xml


Leave a Reply

Your email address will not be published. Required fields are marked *