title: Getting some errors on setActionBar()
body: <p>So i'm having some trouble with my code with this error
  i'm using androidx and i think the problem is because of dat.
  for being honest i don't know how to change to old version android</p>
  
  <p>so the error is this </p>
  
  <pre><code>error: incompatible types: androidx.appcompat.widget.Toolbar cannot be converted to android.widget.Toolbar
  </code></pre>
  
  <p>I already tried to import android.support.v7.wigdet.Toolbar did not work :(</p>
  
  <p><strong>MainActivity.Java</strong></p>
  
  <pre><code>import androidx.appcompat.app.AppCompatActivity;
  import androidx.appcompat.widget.Toolbar;
  
  
  
  import android.os.Bundle;
  
  public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          Toolbar toolbar = findViewById(R.id.toolbar);
          setActionBar(toolbar);
      }
  </code></pre>
  
  <p><strong>nav_header.xml</strong>
  <a href="https://i.stack.imgur.com/q4O3d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q4O3d.png" alt="enter image description here"></a></p>
  
  <p><strong>activity_main.xml</strong>
  <a href="https://i.stack.imgur.com/o35TS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o35TS.png" alt="**activity_main.xml**"></a></p>
  
  <p><strong>Build.gradle</strong>
  <a href="https://i.stack.imgur.com/xRpyG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xRpyG.png" alt="enter image description here"></a></p>
  
  <p>Update error when run</p>
  
  <pre><code>E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.example.readytogo, PID: 8403
      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.readytogo/com.example.readytogo.MainActivity}: android.view.InflateException: Binary XML file line #26 in com.example.readytogo:layout/activity_main: Binary XML file line #26 in com.example.readytogo:layout/activity_main: Error inflating class fragment
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3260)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3396)
          at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
          at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2009)
          at android.os.Handler.dispatchMessage(Handler.java:107)
          at android.os.Looper.loop(Looper.java:214)
          at android.app.ActivityThread.main(ActivityThread.java:7319)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:934)
       Caused by: android.view.InflateException: Binary XML file line #26 in com.example.readytogo:layout/activity_main: Binary XML file line #26 in com.example.readytogo:layout/activity_main: Error inflating class fragment
       Caused by: android.view.InflateException: Binary XML file line #26 in com.example.readytogo:layout/activity_main: Error inflating class fragment
       Caused by: java.lang.NullPointerException
          at java.lang.VMClassLoader.findLoadedClass(Native Method)
          at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
          at android.app.Fragment.instantiate(Fragment.java:536)
          at android.app.FragmentContainer.instantiate(FragmentContainer.java:53)
          at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:3553)
          at android.app.FragmentController.onCreateView(FragmentController.java:104)
          at android.app.Activity.onCreateView(Activity.java:6929)
          at androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:326)
          at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1069)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:997)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
          at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:470)
          at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:141)
          at com.example.readytogo.MainActivity.onCreate(MainActivity.java:16)
          at android.app.Activity.performCreate(Activity.java:7783)
          at android.app.Activity.performCreate(Activity.java:7772)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3235)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3396)
          at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
          at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2009)
  E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:107)
          at android.os.Looper.loop(Looper.java:214)
          at android.app.ActivityThread.main(ActivityThread.java:7319)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:934)
  </code></pre>