0
我是Kumulos開發新手。從Kumulos的表中選擇數據
我想從kumulos表中選擇數據。
贊如果用戶輸入用戶名和密碼,我從表中檢查數據是否存在。
但問題是,檢查數據插入表中,而不是給我正確的輸出。
在瀏覽器中測試API時,它工作正常。
我的代碼從表中選擇如下。
public void CallApiLogin(){
final String Uname=editUname.getText().toString();
final String pass=editPass.getText().toString();
HashMap<String, String> params = new HashMap<String, String>();
params.put("name", Uname);
params.put("password",pass);
Kumulos.call("user_register", params, new ResponseHandler() {
@Override
public void didCompleteWithResult(Object result) {
// Do updates to UI/data models based on result
ArrayList<LinkedHashMap<String, Object>> objects = (ArrayList<LinkedHashMap<String,Object>>) result;
for (LinkedHashMap<String, Object> item : objects) {
String name = (String) item.get("name");
String password = (String) item.get("password");
if(name.equalsIgnoreCase(Uname) && password.equalsIgnoreCase(pass)){
Intent i=new Intent(Login.this,Home.class);
startActivity(i);
}else{
Toast.makeText(getApplicationContext(),"Please enter valid username and password.",Toast.LENGTH_SHORT).show();
}
}
}
});
}
請建議我哪裏出錯了,因爲請求的數據插入表中。
但我想請求數據存在或不?