I have 100 items, all have an image and some description, i have a ListView
and i want to open the items with ListView
, so how do i do that ? i want to show description and image for each item. do i need 101 activities?
Asked
Active
Viewed 60 times
0

Spring Breaker
- 8,233
- 3
- 36
- 60

Apk
- 153
- 1
- 2
- 18
-
You can just use two Activities, one to display the list and other to display detail. Use intent to transfer info about which item was clicked. – hypd09 Jan 29 '14 at 06:18
-
No use only one extra activity, everytime u click listview item change the content of that activity. – keshav Jan 29 '14 at 06:18
-
@Keshav how do i do that? – Apk Jan 29 '14 at 06:21
-
1Pass id of selected Item in Next Activity and get Data using that id – Pratik Butani Jan 29 '14 at 06:23
-
In which form you have 100 Items, please post some code or briefly explain. – Pratik Butani Jan 29 '14 at 06:24
3 Answers
0
No You Can Use Listview With Image And Text Using List Adpter Here I Send You Link See My Answer Step By Step U Follw it.Listview With Imageview
-
wait i give you link and before i send u link plz tel me u have to laod image from drwable or url – ishu Jan 29 '14 at 06:27
-
http://theopentutorials.com/tutorials/android/listview/android-custom-listview-with-image-and-text-using-arrayadapter/ see this example – ishu Jan 29 '14 at 06:35
-
-
why are there three packages in that example? can i put the 3 class files in one package? – Apk Jan 29 '14 at 06:45
-
One is main activty,second is adpter and third one is for your listview row – ishu Jan 29 '14 at 06:51
-
-
-1
-
that is also possible with this code. I did it offline only. Little alteration is needed. The code is very efficient. Since you load 100 images, so u need to take care of memory. With this it is possible – Sushil Jan 29 '14 at 06:38
-
http://theopentutorials.com/tutorials/android/listview/android-custom-listview-with-image-and-text-using-arrayadapter/ – Apk Jan 29 '14 at 06:48
-
but i see three packages in the example, can i put the three class files in one package instead? – Apk Jan 29 '14 at 06:49
-
ya u can put this three class in one package and ya u have to compulsury take three clas – ishu Jan 29 '14 at 06:57
-2
No, you only need one activity and one Fragment
. Each time you click one item in the ListView, call replace and update your fragment. I think that should be method that helps you refresh its content view . Or you can create a new one (not best solution)

suitianshi
- 3,300
- 1
- 17
- 34
-
need one adapter class and main activity then add adpter to listview . for more information check this link :- http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/ – Dakshesh Khatri Jan 29 '14 at 06:22
-