package com.afifzafri.studentsdb;

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

public class InsertData extends AppCompatActivity {

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

        // initialize input fields and buttons
        EditText studID = (EditText)findViewById(R.id.editStudID);
        EditText name = (EditText)findViewById(R.id.editName);
        EditText ic = (EditText)findViewById(R.id.editIC);
        EditText dob = (EditText)findViewById(R.id.editDOB);
        EditText address = (EditText)findViewById(R.id.editAddress);
        EditText program = (EditText)findViewById(R.id.editProgram);
        EditText phone = (EditText)findViewById(R.id.editPhone);
        EditText email = (EditText)findViewById(R.id.editEmail);
        Button btnClear = (Button)findViewById(R.id.btnClear);
        Button btnSave = (Button)findViewById(R.id.btnSave);

        // button on click action
        btnClear.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // action here
            }
        });

        btnSave.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // action here
            }
        });


    }
}

@@ -463,32 +463,38 @@
 buttons%0A        
+final 
 EditText studID 
@@ -536,32 +536,38 @@
 tudID);%0A        
+final 
 EditText name = 
@@ -605,32 +605,38 @@
 tName);%0A        
+final 
 EditText ic = (E
@@ -670,32 +670,38 @@
 ditIC);%0A        
+final 
 EditText dob = (
@@ -737,32 +737,38 @@
 itDOB);%0A        
+final 
 EditText address
@@ -812,32 +812,38 @@
 dress);%0A        
+final 
 EditText program
@@ -887,32 +887,38 @@
 ogram);%0A        
+final 
 EditText phone =
@@ -966,16 +966,22 @@
         
+final 
 EditText
@@ -1329,38 +1329,286 @@
             
-// action here
+studID.setText(%22%22);%0A                name.setText(%22%22);%0A                ic.setText(%22%22);%0A                dob.setText(%22%22);%0A                address.setText(%22%22);%0A                program.setText(%22%22);%0A                phone.setText(%22%22);%0A                email.setText(%22%22);
 %0A           

clear fields when clear button clicked