I want to show my web site as android app.
In my code, doesn't work input type=file
I googled "android webview input type file not working".
But only java solution. I want to solve this problem with kotlin.
Anyone has know how to solve this problem?
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
loadWebpage()
}
@Throws(UnsupportedOperationException::class)
fun buildUrl(authority: String) : Uri {
val builder = Uri.Builder()
builder.scheme("https")
.authority(authority)
return builder.build()
}
fun loadWebpage() {
try {
val url = buildUrl("uploader.xzy.pw")
webview.loadUrl(url.toString())
} catch(e: UnsupportedOperationException) {
e.printStackTrace()
}
}
}