1

Okay, so today I updated my SDK tools to level 22 (Yup, this late). Before I was on level 21 and wrote an app. Now after updating to level 22, I want to use android.support.v7.widget.CardView API.

The problem is that when I import android.support.v7.widget.CardView, Android Studio shows error saying "cannot resolve symbol". I used the search and found that there did exist a CardView class in the android.support.v7.widget package.

Moreover, in the android.support.v7.widget.Toolbar API, I can't use some of the newer methods added like the setActionbar() method.

I also can't seem to import the AppCompatActivity class.

I have updated the Target API to level 22.

Can anyone offer some help?

Pratyush Yadav
  • 271
  • 1
  • 13
  • com.android.support:cardview-v7 – ecle Jun 27 '15 at 22:10
  • Thanks... It worked. Any solution for the Toolbar's setActionBar() method not showing – Pratyush Yadav Jun 28 '15 at 18:33
  • If you use AppCompat library, please use `setSupportActionBar(@Nullable Toolbar toolbar)` with whatever style coming from `Theme.AppCompat` – ecle Jun 28 '15 at 23:50
  • http://stackoverflow.com/questions/29025961/setsupportactionbar-toolbar-error – ecle Jun 28 '15 at 23:51
  • Worked it out... I had already added appcompat to the dependency list, but due to some bug, it didn't show up. Added it to the dependency list again and used the setSupportActionbar() method instead – Pratyush Yadav Jun 29 '15 at 18:38

0 Answers0