How can I access bitmaps created in another activity?
Posted
by
user22241
on Game Development
See other posts from Game Development
or by user22241
Published on 2013-03-01T18:02:54Z
Indexed on
2013/06/27
16:30 UTC
Read the original article
Hit count: 262
I am currently loading my game bitmaps when the user presses 'start' in my animated splash screen activity (the first / launch activity) and the app progresses from my this activity to the main game activity,
This is causing choppy animation in the splashscreen while it loads/creates the bitmaps for the new activity.
I've been told that I should load all my bitmaps in one go at the very beginning.
However, I can't work out how to do this - could anyone please point me in the right direction?
I have 2 activities, a splash screen and the main game. Each consist of a class that extends activity and a class that extends SurfaceView
(with an inner class for the rendering / logic updating).
So, for example at the moment I am creating my bitmaps in the constructor of my SurfaceView
class like so:
public class OptionsScreen extends SurfaceView implements
SurfaceHolder.Callback {
//Create variables here
public OptionsScreen(Context context) {
Create bitmaps here
}
public void intialise(){ //This method is called from onCreate() of corresponding application context
// Create scaled bitmaps here (from bitmaps previously created)
}
© Game Development or respective owner