(この記事は Scala Advent Calendar jp 2010 の5日目です。) Scala+Androidで過去にはまったことなどを小ネタとして紹介します。 Androidに限らず、JavaのライブラリをScalaから使用する上でも役にたつかも。 java.lang.Classのインスタンスを取得する ScalaではclassOfを使って取得できます。 Androidでは明示的Intentを作成するときなどに使います。 // Javaの場合 new android.content.Intent(this, HogeService.class) // Scalaの場合 new android.content.Intent(this, classOf[HogeService]) scalaの予約語とおなじ名前のメソッドがあってコンパイルエラーになる android.content.