5

I have a 3 Activities, and all of them has a a ViewFlipper with some images that keep running. The thing is that I load these images from the SDCard, and there are aproximatly 180 images.

EVERY TIME I call one of these activities, it takes some time to the ViewFlipper be completed.. I would like to know if there is something like onAppear for Android.. The contents of Activity changes everytime it gets called, so it can't be singleTask..

I would like to know if there is a way to refresh an Activity content, but without loosing its contents.. Like this: on the onCreate, everything would be done normal, but on something like onAppear, I would only change what I need, so that onCreate would be called only once.

This is how I change between the three Activities:

startActivity(new Intent(FirstOne.this, OtherOne.class));
Praful Bhatnagar
  • 7,425
  • 2
  • 36
  • 44
pedrofialho
  • 147
  • 1
  • 11

2 Answers2

8

You probably need to override the onResume() method

sdabet
  • 18,360
  • 11
  • 89
  • 158
0

If you separate the loading of your images from the Activity by writing an in-memory cache, you can optimize the load times for images that will be used more than once.

Rich
  • 36,270
  • 31
  • 115
  • 154