-1

我不知道如何使用 Where 条件从 Parse 中获取云数据库中的条件数据。

4

1 回答 1

0
    ParseQuery query = new ParseQuery("login");
    query.whereEqualTo("username", user);
    query.whereEqualTo("password", pass);
    query.findInBackground(new FindCallback() {

        @Override
        public void done(List<ParseObject> obj, ParseException e) {

            if (e == null) {


                 if(obj.size() == 1){
                     prog.dismiss();
                     Toast.makeText(con, "Login Success..", Toast.LENGTH_SHORT).show();
                     Intent in = new Intent(con, home.class);
                     con.startActivity(in);
                     con.finish();                               
                 }else {
                    Toast.makeText(con, "Password Wrong....", Toast.LENGTH_SHORT).show();
                }

             } else {
                 System.out.println("Fail.....................  ");
                 Toast.makeText(con, "Login Fail..", Toast.LENGTH_SHORT).show();
                 System.exit(0);
             }
        }
    });
于 2012-11-03T07:51:58.980 回答