tuenti / SmsRadar

Android library created to listen incoming and outgoing SMS's
Apache License 2.0
393 stars 116 forks source link

Boolean parameter transfer problem #10

Closed beilly closed 8 years ago

beilly commented 9 years ago

boolean notifyForDescendents = true; contentResolver.registerContentObserver(smsUri, notifyForDescendents, smsObserver); what is different to “contentResolver.registerContentObserver(smsUri, true, smsObserver); ”?and you have used many in your code...

pedrovgs commented 9 years ago

Hi @shibenli there is no difference between:

boolean notifyForDescendents = true; 
contentResolver.registerContentObserver(smsUri, notifyForDescendents, smsObserver); 

and

contentResolver.registerContentObserver(smsUri, true, smsObserver); 

We used to extract the true hardcoded values to local variables to improve the code readability.

Is this the answer to your questions?

beilly commented 8 years ago

@pedrovgs , thank you very much.That can improve the "true" means function,and it's highly readable code