Android, how to stop reading getView() function again, if the content is already downloaded in the ListView

I am a newbie Android guy.

I have a ListView displaying images on every element of the ListView, It works fine... but when I start to scrolling I have realized my image is downloaded again if it is displayed in the screen of my phone device!

How could I stop reloading the images or all the content of the in ListView again? Or how could I avoid reading the getView() function again If I have already downloaded all its content?


Asked by: Kelsey994 | Posted: 25-01-2022






Answer 1

It is possible to create an efficient adapter with different view types. Take a look at this question.

It's fairly simple. Just need to override getItemViewType and getViewTypeCount. Then you can count on convertView being the correct view type.

Answered by: Emma228 | Posted: 26-02-2022



Similar questions

exception - Android & SQLite: "Table audios has no column named downloaded"

I get this weird exception when i run my app on both the emulator and a USB connected device. i can see the table inside the shell, but when I try to insert a record from the Activity acton I get this exception: android.database.sqlite.SQLiteException: table audios has no column named downloaded I am mostly running on an emulator with Android 1.5. The predominant part of my code i...


android - how can I import .apk file of the downloaded file into Eclipse? Do we have this option?

I am newb To Android.I just to check out few applications in my Desktop and have downloaded some sample applications. However, they are in the format .apk. Please let me know the procedure to import this file into Eclipse which helps me to run the application. Regards, Serenity.


eclipse - How to start an android project with downloaded sample code

I'm pretty new to android, and just finished setup my environment and reading some tutorials. Then I got sdk samples from the web. Okay, what I wanna ask you is that is there a way to start a sample as a project in the Eclipse? I mean like clicking a project file in c# or a solution file. Here is my folder which I unzipped the code, \android-sdk-windows\samples\android-8\NotePad There are three folders and ...


Android: showing default image in gallery's ImageView while actual image is downloaded

I believe this is pretty trivial but I can't get it to work. I want to display a default image in gallery elements (ImageViews) while their actual image is being fetched from the net. Right now, nothing is shown for an ImageView which its image has yet to arrive. Once it arrives it is immediately shown. What I tried is right after the instantiation of the ImageView to call its setImageResource function like so:...


How to read the downloaded file in android?

I configure my email in the Android simulator(Default Email configuration in android aimulator 2.1) .And I download the attachment from my mail. I need to read that file in my application .Is there any possibility to read the file in my application. I am new to android. Can anyone help me to solve this ??? Thanks in advance? Note in the Eclipse android file explore it show the data in data/data/com.email.attachme...


How to store downloaded images in to android SD card

Hi I am developing app which downloads the images from the web site and then i am displaying them as slide show. Now I want save the downloaded images into my SD card please help me. My current attempt is: File imageFileFolder = new File(Environment .getExternalStorageDirectory(), "test"); imageFileFolder.mkdir(); File imageFileName = new File(imageFileFolder, date + p...


download - android: Detect if App was downloaded from market

I've got an app which I would like to distribute through the market place and also from my own site. How do I, using only one build and one key, check to see if the app was downloaded from the market place or not? This question is answered by having the code signed with different keys, but we ideally want a si...


how to save downloaded files in cache android

Hi i'm streaming video from a website in my android application. I have a history option showing the last seen videos. I wonder if i can use cache so that when the user enters the history the video is played faster (not downloaded again). When you use cache in Android does that mean that the whole video is downloaded and saved somewhere? or some data is saved somwhere(not the whole video). Some help will be appreci...


android - Downloaded Facebook app replaces my App's facebook login page

i am about to complete my application but i am facing few problems with facebook and twitter. 1). I have downloaded and installed facebook application in my device but now when my app redirects on facebook as per it's flow, it open ups that installed facebook app instead of my FB official SDK login screen. Any solution to this? 2). I am using Fb Official SDK and twitter4j 2.1.7 which was working perfectly, ...


How to cache downloaded google maps data on an Android activity?

I have a MapView acitivty and it download some maps data from google. How can I cache these data and how can I load them again to use offline? I need these maps cached to use them when there is no way to download them (neither 3G nor Wifi connection). GPS gets localization, but if there's no map, it is not helpful for user. Note: Some comment in this post, said that is violation to Google Maps ...






Still can't find your answer? Check out these communities...



Android Google Support | Android Community | Android Community (Facebook) | Dev.io Android



top