How to import android.net.Uri in an Android Studio scratch file?

503 views Asked by At

I tried to run the following program in an Android Studio scratch file:

import android.net.Uri
println (Uri.encode("?"))

But it fails with the following error:

Unresolved reference: android

But this seems to work:

import java.net.URLEncoder
println (URLEncoder.encode("?", Charsets.UTF_8.name()))

How to tell Android Studio about android?

0

There are 0 answers