0

I am statring programming in Android and i have problem. I must create something like this : https://www.google.pl/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0CAcQjRw&url=http%3A%2F%2Fwww.technotalkative.com%2Fandroid-asynchronous-image-loading-in-listview%2F&ei=R3UKVdTXHoOGzAPO2oKQBw&bvm=bv.88528373,d.bGQ&psig=AFQjCNFkuC6H_DmyQz44Xy2xYZOnb7fAtA&ust=1426835140929053

but after clicked i need to go to second activity with bigger clicked image and descriptiont (e.g On the image is some place and under is description this place) For this moment i have first activity ImageView+TextView(title) but i do not know how i can get something what let me identifiers clicked image and send send to second activity. Any ideas ?

I found topic like this : How can i pass image view between activities in android but this not resolve my problem.

Edit: I have 2 xml activity for now : First main activity with listview and second with linearlayout+Imageview+TextView. I use this tutorial for create firs screen : http://javastart.pl/static/programowanie-android/wlasny-widok-listowy/

Community
  • 1
  • 1
Mikolaj
  • 21
  • 1
  • 1
    if you load image from url then use AndroidQuery library for load image in asynchronously and simple pass image url in another activity and try load same way in another activity. check out my ans here : http://stackoverflow.com/questions/2471935/how-to-load-an-imageview-by-url-in-android/24134425#24134425 – Haresh Chhelana Mar 19 '15 at 07:29

2 Answers2

0

Create an OnItemClickListener and set it on your listview. The listener's onClick method is then called whenever you click an entry in the list. It has a parameter 'position' which tells you which row of the list got clicked. Now you can get the URL of the clicked image using imageUrl[position] (following your example).

Now start your second activity and pass that URL along like so:

Intent intent = new Intent(this, SecondActivity.class);
intent.putExtra("imageUrl", imageUrl[position]);
startActivity(intent);

In your second Activity, put this in the onResume method:

String imageUrl = getIntent().getStringExtra("imageUrl");

Voila, you've passed the url of the clicked image along to the second activity. Now just load it into your ImageView and you're done.

Ridcully
  • 23,362
  • 7
  • 71
  • 86
0

you can send bitmap of image in list via intent to other activity , so you will not need to load it again check attached answer

Or Try to use cached image library like that leocadiotine/WebCachedImageView and pass link string via intent

Community
  • 1
  • 1
Ramy Sabry
  • 378
  • 2
  • 9