优化代码

pull/768/head
gedoor 4 years ago
parent 65dcf89dc2
commit fa72c4e698
  1. 9
      app/src/main/java/io/legado/app/utils/FragmentExtensions.kt

@ -69,11 +69,10 @@ inline fun <reified T : Activity> Fragment.startActivity(vararg params: Pair<Str
inline fun <reified T : Activity> Fragment.startActivityForResult( inline fun <reified T : Activity> Fragment.startActivityForResult(
requestCode: Int, requestCode: Int,
vararg params: Pair<String, Any?> vararg params: Pair<String, Any?>
) = ) = startActivityForResult(
startActivityForResult( AnkoInternals.createIntent(requireActivity(), T::class.java, params),
AnkoInternals.createIntent(requireActivity(), T::class.java, params), requestCode
requestCode )
)
inline fun <reified T : Service> Fragment.startService(vararg params: Pair<String, Any?>) = inline fun <reified T : Service> Fragment.startService(vararg params: Pair<String, Any?>) =
AnkoInternals.internalStartService(requireActivity(), T::class.java, params) AnkoInternals.internalStartService(requireActivity(), T::class.java, params)

Loading…
Cancel
Save