cancel(getIntent().getExtras().getInt(“notificationID”));
why we use of dot operator in between these methods? as cancel(int) method takes only one integer parameter.it has 3 methods as parametr…..what exactly the code will do..?
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.
You should try going through the concepts of object oriented programming first.
To answer your question,
getIntent()returns an object of type intent. We call thegetExtras()on the Intent object which returns an object of type Bundle. Then we callgetInt()on the Bundle object to finally get the int we want to pass to thecancel()method.The statement is equivalent to :
If we don’t need any of the intermediate objects, we can write the whole thing in a single line.
Hope that helps.