Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
199 views
in Technique[技术] by (71.8m points)

Android- java : querying in parse database

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

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

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...