Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

In my app I use parse database.

I want to invite people for a meeting ,but I want to remove invite button from current user.

I'm using if condition to do that but it is not working.

I'm querying a column in parse database, the column name is "sender"


Parse Database Table name is Meeting


below is my if condition . i want to get current user somehow to put inside if condition . if anyone knows help me ?


the function I expect is if current user is equal to sender , invite button should be invisible


 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..... 

 }
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
191 views
Welcome To Ask or Share your Answers For Others

1 Answer

this is the answer for my question.

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.");
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...