class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val url = "https://www.cbr-xml-daily.ru/daily_json.js"
val nameList = ArrayList<String>()
rqbtn.setOnClickListener {
val queue = Volley.newRequestQueue(this)
val stringRequest = StringRequest(com.android.volley.Request.Method.GET, url,
{ response ->
nameList.add(response.substring(0, response.length))
},
{ println("That didn't work!") })
queue.add(stringRequest)
rqview.adapter = ArrayAdapter(this, android.R.layout.simple_list_item_1, nameList)
}
}
}