H
HyMyNameIs115
Guest
Hello.
I would like to get HTML code from URL with Ion library, but when I clicked the button the application thrown out.
Here is the code somebody, please help me
If the application makes the HTML I would like to save this file automatically:
class MainActivity : AppCompatActivity() {
var button1: Button? = null
var text1: TextView? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
button1 = findViewById<Button>(R.id.button1) as Button
text1 = findViewById<TextView>(R.id.text1) as TextView
button1.setOnClickListener{
Ion.with(applicationContext)
.load("http://protondrive.com")
.asString()
.setCallback {e,result -> text1!!.text = result }
}
}
}
I would like to get HTML code from URL with Ion library, but when I clicked the button the application thrown out.
Here is the code somebody, please help me
If the application makes the HTML I would like to save this file automatically:
class MainActivity : AppCompatActivity() {
var button1: Button? = null
var text1: TextView? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
button1 = findViewById<Button>(R.id.button1) as Button
text1 = findViewById<TextView>(R.id.text1) as TextView
button1.setOnClickListener{
Ion.with(applicationContext)
.load("http://protondrive.com")
.asString()
.setCallback {e,result -> text1!!.text = result }
}
}
}