edit ContextExtensions.kt

pull/840/head
gedoor 4 years ago
parent 52331d5412
commit 4fd945287f
  1. 5
      app/src/main/java/io/legado/app/utils/ContextExtensions.kt

@ -28,7 +28,10 @@ import java.io.File
import java.io.FileOutputStream import java.io.FileOutputStream
inline fun <reified A : Activity> Context.startActivity(configIntent: Intent.() -> Unit = {}) { inline fun <reified A : Activity> Context.startActivity(configIntent: Intent.() -> Unit = {}) {
startActivity(Intent(this, A::class.java).apply(configIntent)) val intent = Intent(this, A::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
intent.apply(configIntent)
startActivity(intent)
} }
inline fun <reified T : Service> Context.startService(configIntent: Intent.() -> Unit = {}) { inline fun <reified T : Service> Context.startService(configIntent: Intent.() -> Unit = {}) {

Loading…
Cancel
Save