Skip to content Skip to sidebar Skip to footer

How To Customize Android Title Bar In Fragments Oncreateview

I am trying to change the view of titlebar by typical approach: @Override public View onCreateView(LayoutInflater inflater, ViewGroup group, Bundle args) { ... Window windo

Solution 1:

You are inflating a whole new view and trying to find the progressbar / textview in that newly inflated view by using this code:

ProgressBar progressBar = (ProgressBar) inflater.inflate(R.layout.brand_update_layout, group, false).findViewById(R.id.title_progress);
TextView title_Text = (TextView) inflater.inflate(R.layout.brand_update_layout, group, false).findViewById(R.id.title_text);

Try changing it to this

ProgressBarprogressBar= (ProgressBar)window.findViewById(R.id.title_progress);
TextViewtitle_Text= (TextView)window.findViewById(R.id.title_text);

Post a Comment for "How To Customize Android Title Bar In Fragments Oncreateview"