Replace deprecated getParcelable* methods with compat versions (#3633)
This commit is contained in:
parent
8e87b5d465
commit
85b7caa887
9 changed files with 148 additions and 219 deletions
|
|
@ -16,6 +16,7 @@ import android.util.Log
|
|||
import androidx.annotation.StringRes
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.ServiceCompat
|
||||
import androidx.core.content.IntentCompat
|
||||
import at.connyduck.calladapter.networkresult.fold
|
||||
import com.keylesspalace.tusky.MainActivity
|
||||
import com.keylesspalace.tusky.R
|
||||
|
|
@ -83,7 +84,7 @@ class SendStatusService : Service(), Injectable {
|
|||
|
||||
override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int {
|
||||
if (intent.hasExtra(KEY_STATUS)) {
|
||||
val statusToSend: StatusToSend = intent.getParcelableExtra(KEY_STATUS)
|
||||
val statusToSend: StatusToSend = IntentCompat.getParcelableExtra(intent, KEY_STATUS, StatusToSend::class.java)
|
||||
?: throw IllegalStateException("SendStatusService started without $KEY_STATUS extra")
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue