Move from one activity to another activity with data in android studio

 

Hello everyone, in this post I will share a simple tutorial for those of you who are just learning to make android applications using android studio.


In this tutorial we will learn to move from one activity to another activity with data in android studio.



1. Create New Project


   The first thing we have to do is of course create a new project in android studio. In this tutorial I named the project "MoveActivity".




2. Create desain user interface


   Open activity_main.xml in the folder layout, then add element as follows



   Right click on layout folder then select "New" and "Layout resource file " and then fill the file name with second_activity , then add element as follows




move from activity android studio

4. Add Java File

Open MainActivity in java folder, then copy the code below




Right click on java folder then select "New" and "Java Class File"  and then fill the file name with "SecondActivity"






5. Edit AndroidManifest XML



6. Run the project




Featured Post

How to fix CLS issue in your blog or web ?

  Fixing CLS issues is a big deal. That's because most of your competitors won't fix CLS problems and as a result won't rank wel...