Skip to content

Commit

Permalink
Update annotations to match SDK upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
sakusaku3939 committed Nov 8, 2024
1 parent 4f4266d commit 3433d31
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
package com.example.deeplviewer.service

import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.content.Intent
import android.os.Build
import android.service.quicksettings.TileService
import androidx.annotation.RequiresApi
import com.example.deeplviewer.activity.FloatingTextSelection

@RequiresApi(Build.VERSION_CODES.N)
@TargetApi(Build.VERSION_CODES.N)
class QSTileService : TileService() {
override fun onClick() {
val intent = Intent(applicationContext, FloatingTextSelection::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.putExtra(Intent.EXTRA_TEXT, "")
startActivityAndCollapse(intent)

@SuppressLint("StartActivityAndCollapseDeprecated")
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startActivity(intent)
} else {
startActivityAndCollapse(intent)
}
}
}

0 comments on commit 3433d31

Please sign in to comment.