

New Intent(_ACTION, ContentURI.create("")) For example, to view a website in the browser, you would create an Intent with the VIEW action and the data set to a Website-URI. The data is expressed as a Uniform Resource Indicator (URI). Typical values for action are MAIN (the front door of the application), VIEW, PICK, EDIT, etc. The two most important parts of the intent data structure are the action and the data to act upon. Intent describe what an application wants done. Android retains history stacks for each application launched from the home screen.Īndroid uses a special class called Intent to move from screen to screen. Screens can also choose to be removed from the history stack when it would be inappropriate for them to remain. The user can navigate backward through previously opened screens in the history. When a new screen opens, the previous screen is paused and put onto a history stack. Each of these screens would be implemented as an activity. For example, a text messaging application might have one screen that shows a list of contacts to send messages to, a second screen to write the message to the chosen contact, and other screens to review old messages or change settings.

Most applications consist of multiple screens. Your class will display a user interface composed of Views and respond to events. Each activity is implemented as a single class that extends the Activity base class. An activity is usually a single screen in your application.

We will discuss soon, what the AndroidManifest.xml is responsible for.Īctivities are the most common of the four Android building blocks. This is an XML file where you declare the components of your application and what their capabilities and requirements are. Once you have decided what components you need for your application, you should list them in a file called AndroidManifest.xml. Not every application needs to have all four, but your application will be written with some combination of these. import .activity_main.There are four building blocks to an Android application:.
