Skip to content

Instantly share code, notes, and snippets.

View milessabin's full-sized avatar

Miles Sabin milessabin

View GitHub Profile
case class ServiceId[T](id : Int)
implicit val lisServiceId =
ServiceId[android.view.LayoutInflater](Context.LAYOUT_INFLATER_SERVICE)
def service[T](implicit sid: ServiceId[T]): T = {
context.getSystemService(sid.id).asInstanceOf[T]
}