I'm having trouble with android studio when I try to load an image from an url that requires login to view particular picture.
This is the code that gets the Image URL and it do returns an absolute URL of that image.
Document document = Jsoup.connect(url + "home").timeout(0).header("Cookie", cookie).get();
String imageUrl = document.select("MY CSS SELECTOR").attr("abs:data-src");
and I am using this code to convert that url to Bitmap Image
URLConnection connection = new java.net.URL(imageUrl).openConnection();
connection.setRequestProperty("Cookie", cookie);
connection.connect();
Bitmap temp = BitmapFactory.decodeStream(connection.getInputStream());
So I'm guessing that my second code isn't working as intended and I want to know how I can load image only shows when I am logged in.
Thanks