Posts

Showing posts with the label Intent

Data Passing (Using Intent)

Image
Before proceeding further first make sure that you should know a little about Intent.  If you already know what is intent than you can skip this step. And If you want to know what is Intent and how we can use it to navigate the user to the next screen then you should check my previous blog about Navigate Activity (Using Intent) .  So now you understand how to use intent. Now look forward to sending the data other activity. In the real-time application, sometimes we have to carry the required data to another screen to perform some task based on it. In android, we can pass those data using intent.  The intent is not only used to navigate the user to the next screen but also help us to carry the essential data from one place to another. To pass the data from intent we are using the  putExtra() method of intent.  Let's check with an example :           Button newActivity= (Button) findViewById(R.id. button )    ...

Navigate Activity (Using Intent)

Image
Intent If you are new to android and want to know what is an Intent and how we can use the intent for navigation in the application then you are at the right place. What is an Intent? The intent is an object in android, used to communicate between different components in androids such as activity, services, component, and broadcast  receiver.  It also helps to pass the data between different components. How to navigate from one activity to another activity in android? Intent mIntent = new Intent(context, yourActivityName.class);   startActivity(mIntent); In android, we are using the intent to navigate from one screen to another screen. Don't hesitate if you don't know how to use it, let's check it with an example. Navigation Code:- First, you have to create a to navigate activity. For creating an activity right on the folder where you want to add the activity and select java class. Give the appropriate name to that file(Here I m using Second-Activ...