Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

453
Views
Material Slider OnSliderTouchListener's methods can only be called from within the same library group

Implementing BaseOnSliderTouchListener's onStartTrackingTouch and onStopTrackingTouch (documentation) give the lint the following error message :

Error: BaseOnSliderTouchListener.onStartTrackingTouch can only be called from within the same library group (referenced groupId=com.google.android.material from groupId=your-group-id) [RestrictedApi]

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Temporary solution:

Add @SuppressLint("RestrictedApi") annotation.

Example:

    slider.addOnSliderTouchListener(object : Slider.OnSliderTouchListener {
        @SuppressLint("RestrictedApi")
        override fun onStartTrackingTouch(slider: Slider) {
             [...]
        }

        @SuppressLint("RestrictedApi")
        override fun onStopTrackingTouch(slider: Slider) {
          [...]
        }
    })
over 4 years ago · Santiago Trujillo Report

0

I had the same issue. The workaround with @SuppressLint("RestrictedApi") works.

The root cause is that the BaseOnSliderTouchListener class has a library restricted scope and the methods exposed there are not overridden in OnSliderTouchListener.

The issue is tracked in the material-components library here: https://github.com/material-components/material-components-android/issues/2493

It has been fixed in the 1.6.0-alpha02 release of material-components.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!