Host distribution and introduction ActivityState

1 host
the previous chapter has introduced the Gallery of basic business units are AcitvityState, but ActivityState do not have the ability to operate independently, it must rely on a carrier to operate;
the previous chapter we mentioned ActivityState this class somewhat similar Activity, have their own the life-cycle approach, such as onCreate, onStart, onResume, onPause, onStop, onDestroy etc. these methods along with the life cycle where the Activity is invoked; such as Activity onResume, and in StateManager the top of the stack ActivityState onResume will be called; then Activity here we call it the host;
it only Activity host it? There is also a carrier in the Android provides all the callbacks similar processes in Activity life cycle, it is the Fragment; although Fragment Activity-dependent survival itself, but it also has a complete set of lifecycle process, which is sufficient for ActivityState ; the
so mentioned here, we can clearly understand the contents of the FIG:

Here Insert Picture Description
UI library to show the main business is based on the OpenGL implementation, providing most convenient environment OpenGL in Android View is GLSurfaceView, so the hosts need to provide GLSurfaceView. Activity at one host onCreate setContentView provided in the main View includes GLSurfaceView to another View Fragment returned when the host contained GLSurfaceView to onCreateView;
in the library to different scenarios require some common characteristics Fragment package in a class called AbstractGalleryFragment of the support GLSurfaceVie

Guess you like

Origin blog.csdn.net/qq_42894864/article/details/102668507