Home > Mobile >  [for] setSupportActionBar (toolbar); An error
[for] setSupportActionBar (toolbar); An error

Time:09-26

As shown in figure, setSupportActionBar (toolbar); An error


I looked at the baidu, online solution the following


But I changed after completely in accordance with the method of online have no effect, as shown in figure, two important import I import, but still error


Help you a great god

CodePudding user response:

Well, solve, make a record
Use the import androidx. Appcompat. Widget. The Toolbar;
Then in the build. Gradle out anything about v7 package depend on problem solving,

Don't use v7 package, what v7 spicy chicken, answer is a little knowledge of the online

CodePudding user response:

Google will support under the contents of the integrated into Androidx package, api28 start will automatically use Androidx package, if you are using Androidx package, so every class under the support package before you need to use Androidx class under the package, can no longer use the class under the support package, instead you use the support package, so can't use the Android package under the class, under the same project can only take one use, both things basic it is to use online support package, so you search out everything with the support package,
  • Related