1

I'm trying to follow this this tutorial to add image into imageView from URL.

public class AndroidLoadImageFromURLActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);            

        ImageView image = (ImageView) findViewById(R.id.image);

        String image_url = "http://api.androidhive.info/images/sample.jpg";

        ImageLoader imgLoader = new ImageLoader(getApplicationContext());


        imgLoader.DisplayImage(image_url, image);
    }
}

However, I have the image urls stored in my database table and would like to grab and display dynamically in java. please kindly show me how to do this in java? Thank you so much!

3
  • no i'm just trying to find a way to do this Commented Oct 16, 2012 at 17:55
  • didnt you succeed in doing it? Commented Oct 16, 2012 at 17:56
  • 1
    This was answered by myself: [FollowLink][1] [1]: stackoverflow.com/questions/12826681/… Commented Oct 16, 2012 at 17:58

1 Answer 1

1

try this link

here there is a function named showImage() which accepts a url as parameter and returns bitmap which you can use to set to the image view.

and dont forget to give the internet permission when dealing with images to be displayed from a url

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.