Skip to content Skip to sidebar Skip to footer

Unable To Access View Outside OnCreateView()

I have trying to update views of fragment from activity.And i am getting nullpointerException. public class MyFragment extends Fragment { TextView tv_date, tv_memo_title; public

Solution 1:

You call setSummary before the Fragment's view have been created. Are you calling it in the Activity's onCreate method?


Solution 2:

when you inflate the view you got to do

View view = inflater.inflate(R.layout.fragment_day_summary, container, false);
return view;

that way you got Null pointer Exseption


Post a Comment for "Unable To Access View Outside OnCreateView()"