「import io.realm.RealmRecyclerViewAdapter」ができずに困っております。
ScheduleAdapterクラスを作成後、その中で「RealmRecyclerViewAdapter」を使用しております。
importして上記を使用したいのですが、なぜかimportできない(反応しない)状態です。
解決方法についてご教示いただけませんでしょうか。
試したこと
bulid.gradleへ下記を記載しましたが、解決できませんでした。
implementation 'androidx.recyclerview:recyclerview:1.1.0'
ScheduleAdapter
import io.realm.OrderedRealmCollection class ScheduleAdapter(data: OrderedRealmCollection<Schedule>) : RealmRecyclerViewAdapter<Schedule, ScheduleAdapter.ViewHolder>(data, true){ }
build.gradle(project)
buildscript { repositories { google() mavenCentral() } dependencies { classpath "com.android.tools.build:gradle:7.0.4" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20" classpath "io.realm:realm-gradle-plugin:10.4.0" } } task clean(type: Delete) { delete rootProject.buildDir }
build.gradle(module)
plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' id 'kotlin-kapt' id 'realm-android' } android { compileSdk 31 defaultConfig { applicationId "com.example.myscheduler3" minSdk 23 targetSdk 31 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } buildFeatures { viewBinding true } } dependencies { implementation 'io.realm:android-adapters:2.1.1' implementation 'androidx.core:core-ktx:1.7.0' implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'com.google.android.material:material:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.3' implementation 'androidx.navigation:navigation-fragment-ktx:2.4.0' implementation 'androidx.navigation:navigation-ui-ktx:2.4.0' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' }
まだ回答がついていません
会員登録して回答してみよう