Activity did appear
Asked Answered
R

2

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));
Repugnance answered 19/11, 2012 at 17:52 Comment(1)
Please do your homework first: developer.android.com/training/basics/activity-lifecycle/…Ceasar
R
8

You probably need to override the onResume() method

Rochdale answered 19/11, 2012 at 18:9 Comment(1)
Yup this is great!Binnie
A
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.

Agogue answered 19/11, 2012 at 18:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.