Skip to content

Commit

Permalink
refactor: use fake Intent constructor in ScanTileService.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
VaiTon committed Aug 21, 2022
1 parent 47a7ba3 commit 3bece45
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ class ScanTileService : TileService() {

override fun onClick() {
super.onClick()
val intent = Intent(this, MainActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
intent.action = "SCAN"
val intent = Intent<MainActivity>(this) {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
action = "SCAN"
}
startActivityAndCollapse(intent)
}
}
}

0 comments on commit 3bece45

Please sign in to comment.