Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add picture from the web #178

Open
klaszlo8207 opened this issue Mar 3, 2019 · 1 comment
Open

Add picture from the web #178

klaszlo8207 opened this issue Mar 3, 2019 · 1 comment

Comments

@klaszlo8207
Copy link

How?:) like http://.../.../asd.jpg

@parth-paghadal
Copy link

parth-paghadal commented Jul 8, 2019

val policy = StrictMode.ThreadPolicy.Builder().permitAll().build()
StrictMode.setThreadPolicy(policy)
try{
val url = URL(YOUR_IMAGE_URL)
val bitmap = BitmapFactory.decodeStream(url.getContent() as InputStream)
}catch (e : Exception){
Log.d("EXCEPTIONONBITMAP",e.message.toString())
}

If you are using kotlin than you can try this.
It works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants