Click here to Skip to main content
15,897,291 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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);

}
});
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900