package com.afifzafri.studentsdb;

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

public class SearchData extends AppCompatActivity {

    // initialize object
    DBHelper mydb;

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

        mydb = new DBHelper(this);

        EditText sid = (EditText)findViewById(R.id.editSearch);
        Button btnSearch = (Button)findViewById(R.id.btnSearch);

        btnSearch.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String studid = sid.getText().toString();
                Cursor cursor = mydb.searchData(studid);
            }
        });
    }
}

@@ -222,16 +222,74 @@
 ditText;
+%0Aimport android.widget.TextView;%0A%0Aimport org.w3c.dom.Text;
 %0A%0Apublic
@@ -715,16 +715,546 @@
 Search);
+%0A        TextView resID = (TextView)findViewById(R.id.resStudID);%0A        TextView resName = (TextView)findViewById(R.id.resName);%0A        TextView resIC = (TextView)findViewById(R.id.resIC);%0A        TextView resDOB = (TextView)findViewById(R.id.resDOB);%0A        TextView resAddress = (TextView)findViewById(R.id.resAddress);%0A        TextView resProgram = (TextView)findViewById(R.id.resProgram);%0A        TextView resPhone = (TextView)findViewById(R.id.resPhone);%0A        TextView resEmail = (TextView)findViewById(R.id.resEmail);
 %0A%0A      

initialize textview for append the search results