title: How to customize android title bar in fragments onCreateView
body: <p>I am trying to change the view of titlebar by typical approach:</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup group, Bundle args) {
      ...
      Window window = getActivity().getWindow();
      window.requestFeature(Window.FEATURE_CUSTOM_TITLE);
      window.setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.brand_update_layout);
      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);
      title_Text.setText(Html.fromHtml("..."));
      progressBar.setVisibility(View.VISIBLE);
      ...
  }
  </code></pre>
  
  <p>But this code does not work on some reason. Whats wrong?</p>
  
  <p><strong>UPD.</strong>
  ok, I declared </p>
  
  <pre><code>    Window window = getWindow();
      window.requestFeature(Window.FEATURE_CUSTOM_TITLE);
      window.setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.brand_update_layout); 
  </code></pre>
  
  <p>in Activity and</p>
  
  <pre><code>    ProgressBar progressBar = (ProgressBar)getActivity().getWindow().findViewById(R.id.title_progress);
      TextView title_Text = (TextView)getActivity().getWindow().findViewById(R.id.title_text);
      title_Text.setText(...);
      progressBar.setVisibility(View.VISIBLE);
  </code></pre>
  
  <p>in fragment, however I have an error:</p>
  
  <pre><code>    ERROR/AndroidRuntime(12213): java.lang.NullPointerException
      at com.quto.ru.CarListFragment.onCreateView(CarListFragment.java:188)
      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:837)
      at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1041)
      at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:616)
      at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1359)
  </code></pre>
  
  <p>on string <code>title_Text.setText(...);</code></p>