there is a problem while i retrive the data from listview and compare it with database to check whether client is register or not
plz reply me fast its very argent.......................
What I have tried:
private ArrayList<string> clientName = new ArrayList<string>(); //name
private ArrayList<string> clientMobile = new ArrayList<string>(); //mobile
private ArrayList<string> clientTime = new ArrayList<string>(); //time
private ListView userList; //clientList
userList.setOnItemClickListener(new OnItemClickListener() {
// Select Appointment for diet plan
public void onItemClick(AdapterView
Name = userList.getSelectedItem(clientName).toString();
mobile_no = userList.getSelectedItem(clientMobile).toString();
Cursor c = null;
c = con.Check_Register();
int count = 0;
count = c.getCount();
if (count > 0) {
for (int i = 0; i < count; i++) {
c.moveToNext();
if (Name.equals(c.getString(0)) &&
mobile_no.equals(c.getString(1))) {
//Toast.makeText(getApplicationContext(), "Login Successful..!!", Toast.LENGTH_LONG).show();
Intent intent = new Intent(getContext(), AddClient.class);
startActivity(intent);
// finish();
break;
}//End of if
}//End of for
} else {
Intent intent = new Intent(getContext(), AddNotifications.class);
startActivity(intent);
// finish();
// Toast.makeText(getContext(), "Login Failed..!!", Toast.LENGTH_LONG).show();
}
// Intent intnt = new Intent(getContext(), UserRegistration.class);
// startActivity(intnt);
}
});