What is difference between setFlags and addFlags for intent. Could any one explain it please.
Help Appreciated.
What is difference between setFlags and addFlags for intent. Could any one explain it
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When you use
setFlagsyou are replacing the old flags… when you useaddFlagsyou are appending new flags. Remember, a flag is just a integer which is power of two… in binary, flags look like this: 1, 10, 100, 1000, etc… (which in this case are 1, 2, 4, 8). So, whataddFlagsdoes is appending the integer you pass using the|operator.