This article analyzes the Android Activity loading method. Share it for your reference, as follows:
Previously analyzed the loading method of activity in Android (refer to the previous article "Analysis of four activities loading modes in Android programming》), let’s analyze it further here.
About the Activity loading method, it's nothing more than
Intent intent = new Intent(); (, ); startActivity(intent);
A problem I encountered before: I kept running this code, loading it once every time, and I couldn't block some junk clicks.
It seems that I tried it myself and finally solved the problem.
Extended a question:
actA jumps actB, where actA includes EditText,
The desired effect: A - 》B - 》A The data in EditText in A still exists.
Use the following code to jump, use singleTask, singleInstance to achieve this effect.
Intent intent = new Intent(); (, ); startActivity(intent);
Use the following code to jump, use singleTask, singleInstance to achieve this effect, but in fact, it is to use ActivityGroup
private void loadingView(Class<?> loadClass,View target){ (); (getLocalActivityManager().startActivity( "", new Intent(this, loadClass)) .getDecorView()); setFocus(target); }
For more information about Android Activity, readers who are interested in view the topic of this site:Android programming activity operation skills summary》
I hope this article will be helpful to everyone's Android programming design.