-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSearch.java
More file actions
67 lines (60 loc) · 2.19 KB
/
Search.java
File metadata and controls
67 lines (60 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package com.example.android.break2;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;
public class Search extends AppCompatActivity {
Controller obj=new Controller();
TextView DummyParameter;
public static ResultSet search;
String[] Names=new String[100];
int active=0;
private RadioGroup radioSexGroup;
private RadioButton radioSexButton;
private Button btnDisplay;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search);
}
public void bindSearch(View view) throws SQLException {
int id= addListenerOnButton();
EditText T=(EditText)findViewById(R.id.editText);
String s= T.getText().toString();
s.toLowerCase();
ResultSet check=obj.GetMovieInfo(s);
ResultSet check1=obj.GetMemberInfo(s);
if(id==0&&check.next())
{
search=obj.GetMovieInfo(s);
Intent intent = new Intent(this,ListOfItems2.class);
intent.putExtra("Current",1);
startActivity(intent);
}
else if(id==1&check1.next())
{
search=obj.GetMemberInfo(s);
Intent intent = new Intent(this,ListOfItems2.class);
intent.putExtra("Current",2);
startActivity(intent);
}
else
Toast.makeText(getApplicationContext(), "No Result Found", Toast.LENGTH_SHORT).show();
}
public int addListenerOnButton() {
radioSexGroup = (RadioGroup) findViewById(R.id.radioSex);
int radioButtonID= radioSexGroup.getCheckedRadioButtonId();
View radioButton = radioSexGroup.findViewById(radioButtonID);
int idx = radioSexGroup.indexOfChild(radioButton);
return idx;
}
}