Android-java:在解析数据库中查询

时间:2017-04-04 13:03:53

标签: android parse-server

  

在我的应用程序中,我使用解析数据库。

我想邀请其他人参加会议,但我想从当前用户中删除邀请按钮。

我正在使用if条件来做到这一点,但它无法正常工作。

我正在查询解析数据库中的列,列名是“sender”

  

解析数据库名称为会议

下面是我的if条件。我想让当前用户以某种方式放入内部如果条件。如果有人知道帮助我?

  

我期望的功能是当前用户是否等于发件人,邀请   按钮应该是不可见的

 if( "sender" == thisPerson.getObjectId()) {

                buttonLayout.setVisibility(View.INVISIBLE);
                inviteMessage.setVisibility(View.INVISIBLE);
                messageLayout.setVisibility(View.VISIBLE);
                inviteMessage.setText("you can invite other people for meeting");


            }else{ 

          code..... 

 }

1 个答案:

答案 0 :(得分:0)

  

这是我的问题的答案。

if(canRequest){
    if(noRequest){
        setButton(false);
        if(ParseUser.getCurrentUser().getObjectId().equals("_User")){

            messageLayout.setVisibility(View.INVISIBLE);
        }else{

            messageLayout.setVisibility(View.VISIBLE);
        }
        buttonLayout.setVisibility(View.VISIBLE);
        inviteMessage.setVisibility(View.VISIBLE);


        if(ParseUser.getCurrentUser().getObjectId().equals(objectId)){
            messageLayout.setVisibility(View.INVISIBLE);
        } else {
            if(parseUser.getObjectId().equals(thisPerson)){
                messageLayout.setVisibility(View.INVISIBLE);
            }else{
                messageLayout.setVisibility(View.VISIBLE);
                inviteMessage.setText("Do you want to invite this person for a meeting?");
            }

        }
    }else{
        if(myInvite){
            setButton(true);
            inviteMessage.setVisibility(View.VISIBLE);
            messageLayout.setVisibility(View.VISIBLE);



            if(meetingStatus.equals("ACCEPTED")){
                buttonLayout.setVisibility(View.INVISIBLE);
                inviteMessage.setText("You request has been accepted, be ready fo the meeting.");
            }else{
                buttonLayout.setVisibility(View.VISIBLE);
                inviteMessage.setText("You have already requested a meeting with this attendee and it's waiting for approval.");
            }

        }else{
            inviteMessage.setVisibility(View.VISIBLE);
            messageLayout.setVisibility(View.VISIBLE);
            buttonLayout.setVisibility(View.VISIBLE);

            if(meetingStatus.equals("ACCEPTED")){
                setButton(false);
                buttonLayout.setVisibility(View.INVISIBLE);
                inviteMessage.setText("You have already accepted the meeting request.");
            }else{

                if(ParseUser.getCurrentUser().getObjectId().equals(objectId)){

                    inviteMessage.setVisibility(View.INVISIBLE);
                }

                else{setButton(false);
                    inviteMessage.setText("You have been requested for a meeting. Do you wish to accept it?");
                }
            }
        }
    }
}else{
    buttonLayout.setVisibility(View.INVISIBLE);
    inviteMessage.setVisibility(View.VISIBLE);
    messageLayout.setVisibility(View.VISIBLE);
    inviteMessage.setText("Sorry, you cannot respond to this event. This event has already passed.");
}