Merhaba,
https://developer.android.com/guide/...java#immediate
Linkte yer alan bölümde override kısmı android studio'da şu şekilde uyarı veriyor (Modifier 'override' is not applicable to 'local function')
parantezleri filan kontrol ettim ama düzelmedi sorunun çözümünü bilen var mı?
Kodun tamamı burada;
companion object {
const val MY_REQUEST_CODE = 100;}
private fun checkUpdates(){
val appUpdateManager = AppUpdateManagerFactory.create(this)
// Returns an intent object that you use to check for an update.
val appUpdateInfoTask = appUpdateManager.appUpdateInfo
// Checks that the platform will allow the specified type of update.
appUpdateInfoTask.addOnSuccessListener { appUpdateInfo ->
if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE
// This example applies an immediate update. To apply a flexible update
// instead, pass in AppUpdateType.FLEXIBLE
&& appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE)
) {
// Request the update.
override fun onResume() {
super.onResume()
appUpdateManager
.appUpdateInfo
.addOnSuccessListener { appUpdateInfo ->
...
if (appUpdateInfo.updateAvailability()
== UpdateAvailability.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS
) {
// If an in-app update is already running, resume the update.
appUpdateManager.startUpdateFlowForResult(
appUpdateInfo,
IMMEDIATE,
this,
MY_REQUEST_CODE
)
}
}
}
}
}
}