This example will show you how to change android device screen orientation ( horizontal to vertical vice versa ) and how to avoid activity restart during the screen orientation change.
When you create android project in android studio, there are a lot of activity templates you can choose which provided by android studio. For android beginners, basic activity and empty activity always make them confused. So what the difference between them, let me tell you now.
This article will tell you how to pass custom type object via intent between two activities. It is not difficult, you just need to make your custom class either implement java.io.Serializable or android.os.Parcelable interface.
This example will show you how to dynamically register / unregister broadcast receiver in android activity. You can read article Android Broadcast Overview to learn basic concepts about android broadcast if you need.
Fragment is widely used in android app development. You can use it statically or dynamically. Article Android Multiple Fragments In One Activity Example has introduce what is and how to use Fragment statically. This article will tell you how to use it dynamically in your android app.
There are so many android devices in the world today. Different device screen size are also different. So when you create an android app, of course you want it can be run in both small size ( android phone ) and big size ( android pad ) devices use only one release build.
This article will show you three best practice when use android activity class. These best practice can make your java source code simple and clear.
Previous article Android Activity Launch Mode Standard SingleTop Example has introduced the two android activity launch mode standard and singleTop. This article will introduce the other two android activity launch mode singleTask and singleInstance which are more difficult to understand.
An activity can be configured with four launch mode, each launch mode is used in one special scenario. This article will introduce all the four launch mode of activity with examples.
When an android activity stopped, it maybe recycled by android OS. But how to store recycled activity instance state data, and use those activity instance data later? Android provide below methods.