我正在使用Sugar ORM并且无法搜索特定对象

时间:2017-10-08 03:21:30

标签: android

searchBtn.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        contacts.addAll(Contact.findWithQuery(Contact.class,"SELECT * FROM Contact where M_NAME_TEXT = ?",search));

       // contacts.equals(Contact.findAll(Contact.class));
        contactAdapter = new ContactAdapter(contacts);
        contactAdapter.updateList(contacts);
        //allContacts.addAll( Contact.listAll(Contact.class));
        //recyclerView.setAdapter(contactAdapter);
        Intent viewContact = new Intent(searchContact.this, ViewContact.class);
        startActivity(viewContact);

    }
    //Contact.find(Contact.class, "mNameText = ?", new String{author.getId()});
    //Contact.findWithQuery(Contact.class, "Select * from contact_hello where mNameText = ?",search );
    //Select.from(Contact.class).where(Condition.prop(search).eq(contacts));
});

0 个答案:

没有答案