0

i wanted to use the ItemTouchHelper Class, which should be available in the standard installation of android studio (so i wrote in the internet).

Anyhow i get an error message, when i try to use this class. You can see in picture. Error helper unknown

What can i do, to implement the necessary libary´s respectively the ItemTouchHelper Class.

Pls speak in easy words and describe so detailed as possible, because I am an absolute Android Beginner :)

I would be so glad about an solution!

Best Regards Fabian


Thank you both for your quick reply!

I added the appcompat line in my build.gradel file.

When building gradle i know get following error message: enter image description here

How can i fix this?

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Check if you have SupportV7 library added as dependencies, refer https://stackoverflow.com/a/26604814/1105291 – Chanchal Shelar Sep 06 '17 at 09:09
  • in apps build.gradel file set minSdkVersion.apiLevel = 9 – Navin Gupta Sep 07 '17 at 06:30
  • Necessary SupportV7 Library dependencies are addes. anyhow Android studio does not know the class... :( This are my dependencies: – Fabian Schmitt Sep 08 '17 at 06:10
  • compile 'com.android.support:support-v4:23.3.0' compile 'com.android.support:gridlayout-v7:23.3.0' compile 'com.android.support:cardview-v7:23.3.0' compile 'com.android.support:recyclerview-v7:21.0.2' – Fabian Schmitt Sep 08 '17 at 06:10

1 Answers1

0

check this link https://developer.android.com/reference/android/support/v7/widget/helper/ItemTouchHelper.html

Here ItemTouchHelper class extends RecyclerView.ItemDecoration implements RecyclerView.OnChildAttachStateChangeListener

so you should add these dependencies in your app's build.gradel file inside dependency block like this

compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
Navin Gupta
  • 793
  • 6
  • 20