Prerequisite

If you not understand this lecture Activity start up using indent object .you should also read my previous lectures.  Project creation using android studio and Open new Activity on button click After read these lecture you will also  able to create Activity of your app.

Overview

Activity is a user interface Almost all the activity are interact with user.Activity is window in which you can place their different component of user interface.Activity display information and invite the user to act in a number of ways.In android, an activity is represent a single screen.

Introduction

In this lecture well we describe how can create Activity in android.We will also describe Activity description description.what is Activity. why we can use it . and how can pass data from one Activity to other.After Reading this lecture you will understand Activity start up using indent in android And i hope you will create Activity your application.

Description of activity

Activity is a basic building block in android.Android Activity always has a User Interface.Android application consists of number of activity.when you create new activity it can be define in manifest file.In android, an activity is represent a single screen. Most applications have multiple activities to represent different screens. for example one activity to display a list of the application , another activity to display the application status. In this lecture we  we will describe how to send data to another activity using indent object  more detail about activity first of all we will create a simple layout which contain two elements first is  edit text and second is  button when user enter a message in text field and click on button then a message will show on another activity.

So first of all we create a new activity in previous lecture we will create two activities in two separates steps first we create java class file then we create layout .XML file .Now in android studio we will create activity and layout in one step.

Click the <java folder> and expand this folder and right click on package name select <new option> then  you select <activity option> they are many categories then you finally  select <blank activity> show in below pic.

Alt Tag layout and java file in one step

After this  step a new window will appears then you will assign activity name  is second activity and layout name is  second layout  and click on finish button show in below pic.

Alt Tag assign name to layout and java file

So the new activity and new layout will add in this package show in below pic.

Alt Tag  second layout

After this step check the manifest file . here the new activity will  add in manifest file or not.Now the new activity will automatically add show in below pic

Alt Tag  new activity include in manifest file

In this example we are going to create a simple UI that includes only (Edit text) and (Button)with Different attributes

 And paste the following code in layout .XML file:
Now  you will open the Graphical layout editor to preview the User Interface that you created.

Alt Tag  edit text and button

Code that are placed in java class file Main Activity.java
Code that are placed in java class file Second Activity.java

Run the application:

Alt Tag  edit text and button

 you will Enter a message like that “master word” in edit text and click on send button.

Alt Tag  Edit text and button output show

Output  when you click on send button this message will show

Alt Tag  click on button start new activity

“Thank you”  for reading this lecture, Hope you got the idea.