Android Tutorial
Software Setup and Configuration
Android Studio
File Structure
Components
Core Topics
Layout
View
Button
Intent and Intent Filters
Toast
RecyclerView
Fragments
Adapters
Other UI Component
Image Loading Libraries
Date and Time
Material Design
Bars
Working with Google Maps
Chart
Animation
Database
Advance Android
Jetpack
Architecture
App Publish
App Monetization
In Android, an "Activity" represents a single screen with a user interface. While the core concept of an "Activity" remains consistent, based on its purpose and how it's used, activities can be categorized in various ways. Here are some classifications based on their usage and behavior:
Standard Activity:
SingleTop Activity:
onNewIntent()
method.SingleTask Activity:
onNewIntent()
method, thereby not creating a new instance.SingleInstance Activity:
singleTask
, but the system doesn't launch any other activities in the same task. Any activity started by this one opens in a separate task.Dialog Activity:
ListActivity:
ListView
.TabActivity:
Fragment
system.ExpandableListActivity:
ListActivity
, but designed to work with expandable lists/ExpandableListView
.PreferenceActivity:
FragmentActivity:
The behavior of an activity, especially how it's instantiated or how it responds to new intents, can be controlled using the launchMode
attribute in the Android Manifest. It's this attribute that can be set to values like standard
, singleTop
, singleTask
, or singleInstance
to determine the activity's behavior.
Remember, while there are various types of activities and behaviors you can utilize, always aim for the simplest design that meets your app's needs. Overcomplicating an app's navigation stack can lead to confusion for both developers and users.