https://kotlinlang.org logo
#android
Title
# android
r

rawtoast

11/10/2017, 11:35 AM
Copy code
import com.beust.klaxon.JsonObject
import com.beust.klaxon.Parser
import com.beust.klaxon.array

val json_dict_string = """{"December":[["Q1 blah"], "Answer: B"], "January":[["Q1 blah"], "Answer: C"]}"""
val parser: Parser = Parser()
val stringBuilder: StringBuilder = StringBuilder(json_dict_string)
val json: JsonObject = parser.parse(stringBuilder) as JsonObject
val decemeber = json.array<String>("19. December - 2013")


fun main(args: Array<String>) {
    println("Start")
    if (decemeber != null) {
        println("not null")
        for (i in 0 until decemeber.size) {
            val qna_list: String = decemeber.get(i)
            println(qna_list)
        }
    } else { println("December was null")}

    println("Fin")
}