0

I am developing android application. Now I have to create the app of newspaper. So on home page I have to display top stories with the images and the text. Now my problem is, there should be so many top stories so I have used horizontal scroll bar to see other stories. Now my idea is to load the images and the text when the user scrolls left or right. Is it possible to do or I have to load all the data on create of the activity. Any help or suggestion is appreciated.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Kushal Shah
  • 1,303
  • 2
  • 17
  • 33

1 Answers1

0

If what you are asking about is Lazy-Loading, then you need to use AsyncTask, as it's the easiest method to implement it.

class Download extends AsyncTask<Integer,Integer,Integer>{
     protected Integer doInBackground(Integer... wat) {
          //Your downloading stuff
     }
     protected Integer onPostExecute(Integer result){
           //Create listview in UI Thread
     }
}

To create an horizontal ListView read here

Community
  • 1
  • 1
0xC0DED00D
  • 19,522
  • 20
  • 117
  • 184