title: NavHostFragment.findNavController can't be applied to a fragment error
body: <p>I am creating a time prompter app for a sport activity. Not able to move back from Settings Fragment  to Launcher Fragment. The code is similar to code that moves back from Action Fragment to Launcher Fragment successfully. I am getting error here that findNavController in NavHostFragment cannot be applied to SettingsFragment. It also says SettingsFragment cannot be converted to Fragment.</p>
  <pre><code>            public void onClick(View view) {
                  NavHostFragment.findNavController(SettingsFragment.this)
                          .navigate(R.id.action_SettingsFragment_to_LauncherFragment);
  </code></pre>
  <pre><code>public class SettingsFragment extends Fragment {
  
      private FragmentSettingsBinding binding;
  
      @Override
      public View onCreateView(
              LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState
      ) {
          binding = FragmentSettingsBinding.inflate(inflater, container, false);
  
          return binding.getRoot();
      }
      public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
          super.onViewCreated(view, savedInstanceState);
  
          binding.goBackButtonSettings.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  NavHostFragment.findNavController(SettingsFragment.this)
                          .navigate(R.id.action_SettingsFragment_to_LauncherFragment);
              }
          });
      }
  
  
  
  }
  </code></pre>
  <p>SettingsFragment xml is below</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:background=&quot;@color/white&quot;
      android:contentDescription=&quot;@string/start_action&quot;
      android:foregroundTint=&quot;@color/teal_700&quot;
      android:textAlignment=&quot;center&quot;
      tools:context=&quot;.SettingsFragment&quot;&gt;
  
      &lt;Button
          android:id=&quot;@+id/goBackButtonSettings&quot;
          android:layout_width=&quot;65dp&quot;
          android:layout_height=&quot;54dp&quot;
          android:layout_marginBottom=&quot;24dp&quot;
          android:background=&quot;@color/teal_200&quot;
          android:backgroundTint=&quot;#F57F17&quot;
          android:text=&quot;@string/goback&quot;
          android:textColor=&quot;@color/black&quot;
          app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
          app:layout_constraintEnd_toEndOf=&quot;parent&quot;
          app:layout_constraintHorizontal_bias=&quot;0.96&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot; /&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  <p>Not able to locate where exactly the code is wrong and fix it. Need help.</p>