Home > Mobile >  Android function is absent but exist in documentation
Android function is absent but exist in documentation

Time:05-13

There is a function addWeakLoadStateListener() in the documentation, but is absent in my build. I have latest version of page 2.

https://developer.android.com/reference/androidx/paging/PagedList#addWeakLoadStateListener(kotlin.Function2)

My dependencies from buld gradle

dependencies {

implementation "androidx.multidex:multidex:2.0.1"

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:2.4.2'
implementation 'androidx.navigation:navigation-ui:2.4.2'
implementation 'androidx.databinding:databinding-runtime:7.1.3'
testImplementation 'junit:junit:4. '
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

implementation 'com.google.dagger:dagger:2.40.5'
annotationProcessor 'com.google.dagger:dagger-compiler:2.40.5'
implementation "com.google.dagger:hilt-android:2.38.1"
annotationProcessor "com.google.dagger:hilt-compiler:2.38.1"
implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03"

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.room:room-runtime:2.4.2'
implementation 'androidx.paging:paging-runtime:2.1.2'
implementation "androidx.activity:activity:1.4.0"
implementation "androidx.fragment:fragment:1.4.1"
implementation 'org.jetbrains:annotations:15.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
annotationProcessor 'androidx.room:room-compiler:2.4.2'
implementation "android.arch.lifecycle:extensions:1.1.1"

implementation 'io.reactivex.rxjava2:rxjava:2.2.2'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'

implementation "androidx.work:work-runtime:2.7.1"

implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.squareup.retrofit2:converter-simplexml:2.3.0'

}

CodePudding user response:

That appears to be new to Paging 3, so you will need to upgrade (e.g., implementation "androidx.paging:paging-common:3.1.1") if you want to use that function.

  • Related