package com.afifzafri.studentsdb;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // get the buttons
        Button btnInsertDataPage = (Button)findViewById(R.id.btnSearchDataPage);
        Button btnViewDataPage = (Button)findViewById(R.id.btnViewDataPage);
        Button btnSearchDataPage = (Button)findViewById(R.id.btnSearchDataPage);

        // open insert data activity page
        btnInsertDataPage.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // action here
            }
        });

        // open view data activity page
        btnViewDataPage.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // action here
            }
        });

        // open search data activity page
        btnSearchDataPage.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // action here
            }
        });
    }
}

@@ -28,16 +28,47 @@
 ntsdb;%0A%0A
+import android.content.Intent;%0A
 import a
@@ -108,16 +108,16 @@
 tivity;%0A
-
 import a
@@ -493,38 +493,38 @@
 iewById(R.id.btn
-Search
+Insert
 DataPage);%0A     
@@ -872,35 +872,190 @@
          // 
-action here
+start new intent, for opening activity%0A                Intent intentPage = new Intent(MainActivity.this, InsertData.class);%0A                startActivity(intentPage);
 %0A           
@@ -1258,38 +1258,133 @@
             
-// action here
+Intent intentPage = new Intent(MainActivity.this, ViewData.class);%0A                startActivity(intentPage);
 %0A           
@@ -1599,22 +1599,119 @@
     
-// action here
+Intent intentPage = new Intent(MainActivity.this, SearchData.class);%0A                startActivity(intentPage);
 %0A   

create Intent for each button to start the activities