content: package com.adafruit.bluefruit.le.connect.app;
  
  import android.os.Bundle;
  import androidx.annotation.NonNull;
  import androidx.annotation.Nullable;
  import androidx.appcompat.app.ActionBar;
  import androidx.appcompat.app.AppCompatActivity;
  import androidx.fragment.app.Fragment;
  import androidx.fragment.app.FragmentActivity;
  
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.TextView;
  
  import com.adafruit.bluefruit.le.connect.BuildConfig;
  import com.adafruit.bluefruit.le.connect.R;
  
  public class AboutFragment extends Fragment {
  
      public AboutFragment() {
          // Required empty public constructor
      }
  
      @SuppressWarnings("UnnecessaryLocalVariable")
      public static AboutFragment newInstance() {
          AboutFragment fragment = new AboutFragment();
          return fragment;
      }
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
      }
  
      @Override
      public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          // Inflate the layout for this fragment
          return inflater.inflate(R.layout.fragment_about, container, false);
      }
  
      @Override
      public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
          super.onViewCreated(view, savedInstanceState);
  
          // Update ActionBar
          setActionBarTitle(R.string.about_title);
  
          TextView versionTextView = view.findViewById(R.id.versionTextView);
          if (versionTextView != null) {
              versionTextView.setText(String.format("v%s", BuildConfig.VERSION_NAME));
          }
  
          FragmentActivity activity = getActivity();
          if (activity != null) {
              activity.invalidateOptionsMenu();        // update options menu with current values
          }
      }
  
  
      // region Action Bar
      protected void setActionBarTitle(int titleStringId) {
          AppCompatActivity activity = (AppCompatActivity) getActivity();
          if (activity != null) {
              ActionBar actionBar = activity.getSupportActionBar();
              if (actionBar != null) {
                  actionBar.setTitle(titleStringId);
                  actionBar.setDisplayHomeAsUpEnabled(true);
              }
          }
      }
  
      // endregion
  }
  