Home > Mobile >  Create LocationRequest for API lower than 31
Create LocationRequest for API lower than 31

Time:11-04

I have compileSdkVersion 32 and now I can create LocationRequest only using LocationRequest.Builder. LocationRequest.create() currently unavailable, means I can't even call this deprecated static method. So any suggestions how to create LocationRequest for API lower than 31? Thanks.

CodePudding user response:

You cannot create a LocationRequest on API Level 30 and below, because LocationRequest itself was added in API Level 31.

You should be able to use LocationRequestCompat as a backwards-compatible replacement, used with LocationManagerCompat.

CodePudding user response:

Solved with using com.google.android.gms.location.LocationRequest

  • Related