Lesson 2 : Activities

LESSON 2

2.1 : CREATE AND START ACTIVITIES

Pada pelajaran kali ini kita akan membuat project agar bisa menyampaikan sebuah pesan dari 1 activity ke activity lainnya dengan cara menggunakan intent dan komponen pendukung lainnya, pembuatan projek ini juga dapat membantu melatih kita untuk terbiasa dalam pembuatan program ini dan juga membantu kita dalam menyelesaikan error (error handling

Task 1 : Create the TwoActivities project

Membuat “Two Activities” Project

Mengisikan nama aktifitas yang diinginkan

Mendefinisikan layout untuk layout utama

Mendefinisikan tombol aksi

Task 2 : Membuat dan mengeksekusi aktivitas ke 2

2.1 Membuat aktifitas ke 2

2.2 Modify the android manifest

 

 

2.3 mendefinisikan layout di layout kedua

 

2.4 add an intent to the main activity

 

Task 3

3.1 add an EditText to the main activity layout

3.2 add a string to the main activity intent extras

3.3 Add a TextView to the second activity for the message

3.4 Modify the second activity to get the extras and display the message

Task 4. Return data back to the main activity

4.1 Add an EditText and a Button to the second activity layout

4.2 Create a response intent in the second activity

4.3 Add TextViews to the main activity layout to display the reply

4.4 Get the reply from the intent extra and display it

HASIL :

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *