Ok, I have this database of 750+ images and I am wondering how to view the images one by one on a page when the filename is clicked from a listview instead of having to create 750+ pages to show each. I am just starting with Android so please help with code and where to put the code etc.
Thanks in advance.
AM
"I am wondering how to view the images one by one on a page when the filename is clicked from a listview instead of having to create 750+ pages to show each."
Ideally, you would have a MySQLiteHelper class with methods to run SQL eg. pick specific image with id
A Main Activity will have a listview showing all images in a ScrollView layout
listAdapter will have a OnClickListener to start new Activity after passing the id of the image clicked, and opening an ImageView in the new activity, which will show the image from your database.
Now go and refer Android Dev Docs to learn about SQLite, listview, scrollview, onclicklistener, imageview
Good Luck
Related
I want to make an app for Android in Eclipse, when the user clicks a button, a camera component is opened and the user takes a picture and clicks save, after that I want that picture that he just took to show in a list. Then if he takes another picture, the picture shows below the first picture and just like that.
I know how to write the code for the camera element, but how can I do that when the user saves the picture that he just took, it would appear in the listview?
Something just like a listview with text and a TextEdit, but instead of text it would be an image and instead of TextEdit it would be the camera component.
Can you help me guys? Thanks!
This is pretty simple. Just create a custom adapter which inflates a row.xml (containing an imageview) in it's getView() method and set the image in there.
There are many many examples of how to do this, and lots on stackoverflow itself. This is a nice example of creating a custom adapter with an imageview and listview.
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?
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
Fedor's LazyList is simple and very efficient, and loads the images from a URL, but I could also modify it to load images from resources folder.
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)
hi i am going to make a to-do list so what i need is that to assign my task and view it as a list view in those list view need 3 text view and 3 images in this 3 images represent 3 activity like alarm, calendar and so on when i click these images its open seperatly i had i know to retrieve the data's from database to list view but did not know how to set multiple image in a single list.and make those images click able.now how can i do that i tried the lazy adaptor but it is used in the parsing phases there is no parsing in my application please help me
there are many different post all over the place about creating custom ListView items. this one is very helpfull and similar to what you want to do.
when working with images and ListViews, it's very important to implement Lazy image loading. the best implementation I know, is ferdovlasove's LazyAdapter.
enjoy...
How do I implement a listview which displays images an text dynamically from the web? Each image has some descriptions to it and I need them to display correctly in each list. The images change every once in a while. So I have to retrieve up to date contents.
I have read this, but have no idea how to include text into it. Any help here?
Thanks.
Here you will find full details and along with Full working Source code
Android lazy image loader example
Use an ListView Adapter like here: http://android.amberfog.com/?p=296.
The getView Method is executed for every row of your ListView, so you have to place your code to load the images right there
When the Data changes simply call notifyDataSetChanged on the ListView Adapter and the ListView will refresh (executs getView again).
I just started Android programming. I have a ListView with an image and some text and I want to change the image when clicked, but the problem is I cannot identify which image is clicked because I am using the same image id and only changing the source.
How can I solve this problem?
My ListView is based on LazyAdapter class model.
If you load the images at runtime, assign an id to each image as you add them.
You can also traverse the list of images by getting the images parent view's children, then check if the image clicked is the same image as the one in the onClick-event.